- 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:57 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-13-2017 02:55 PM
Hi Chuck!
When I go to test a user criteria on a catalog item for a specific user, I noticed that the catalog item is still visible for them and they are just brought to a page that displays 'Not authorized'. I was under the impression it would remove the item completely from the catalog where they can even see it unless they are a part of a group/role. Does User Criteria not include this type of capability? If not, is there an alternative way of achieving this? Any help is appreciated.
Thanks,
Fred

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-13-2017 02:59 PM
Hi Fred,
Can you include some addition details? Steps you took and screenshots are helpful. I'm not quite wrapping my head around the issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-13-2017 06:07 PM
Hi Chuck,
No problem. Here is a screenshot of the user criteria I created for a specific group:
Here is the "available for' related list I added on the catalog item I am trying to hide.
When I login as a user who is not currently is this assignment group defined in the user criteria, they are still able to view the catalog item. 'Apple MacBook Pro'.
Instead of hiding the item itself they can are still able to click on it, but are brought to another page where the 'not authorized' is displayed.
Thanks,
Fred

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2017 05:52 AM
Well that's not right! I don't have an instant answer for you. It appears everything is configured properly. You might need to take this one to support. Let us know what they say.
HI Service Portal - ServiceNow