- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-31-2016 05:10 AM
Hi,
I want to hide a catalog item based on role.
For
role 1 : All Catalog item should be enable
role 2: Last 2 catalog items only enable.
Please help me to fix this.
Regards,
RK
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-19-2018 09:37 PM
Hi,
1. Create a new User Criteria > Give it a meaningful name > Check "Advance",in script section add following code :
if(!user.hasRole("role_who_can_view_item"))
{
condition =false;//set visiility to false if user don't have "role_who_can_view_item" role
}
OR
Configure > Related Lists > Pull Not Available for / Not available for Group and configure it.
Also, double check whether the group from whom you are hiding the items have the correct role.
Refer : Catalog item visibility in ServiceNow
Regards,
Ajay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-31-2016 05:40 AM
You need to use user criteria for this.
Please go through below thread.It might help you.
Thanks,
Mihir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-18-2016 12:40 PM
If your on Eureka..probably the best way until you upgrade is to add the 'entitlement script' field to the catalog item itself (under maintain items)..then write a script that checks if logged in user has x role..if they have role x display i.e. answer = true. if they dont have role x then dont display i.e. answer = false.
Should be simple and easy to do.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-19-2018 09:13 PM
Hello Rshear,
I need to fetch the list of catalog item on the basis of user ( how many catalog item user x can access ). I need an API for the same can you guide me how to achieve this.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-19-2018 09:37 PM
Hi,
1. Create a new User Criteria > Give it a meaningful name > Check "Advance",in script section add following code :
if(!user.hasRole("role_who_can_view_item"))
{
condition =false;//set visiility to false if user don't have "role_who_can_view_item" role
}
OR
Configure > Related Lists > Pull Not Available for / Not available for Group and configure it.
Also, double check whether the group from whom you are hiding the items have the correct role.
Refer : Catalog item visibility in ServiceNow
Regards,
Ajay