Do you want to show the list of the catalog item based on the logged in user’s role, locations, company, department, and group. And you are looking for some solutions or your mind is getting puzzled and you are thinking to write some logic or scripts or if you are planning to put some ACL's then please stop thinking that. You are going into wrong direction.
ServiceNow out of box provides us some features to set the visibility based on the roles, location, company, department, groups. You don’t need to put a single line of code.
In Pre Fuji Release
In Pre Fuji Release servicenow has defined some key related tables to catalog maintain item that can be used to set the catalog item visibility.
You can do the following steps to control the visibility of catalog items based on the logged in user, user’s group ,user’s company, user’s department and user’s location.
Go to the maintain item module available under the service catalog application and personalize the maintain item form. To personalize the maintain item form.
- Open a form of maintain item table(sc_cat_item).
- Right click on the form header and select personalize -> Form.
Add the below mentioned embedded list on the form based on your requirement and save.
Embedded List Visiblity Based on Available for company Company Available for department Department Available at location Location Available for group Group Available for user User
Go to the respective maintain item record and put the values to this list according to your requirement.
For example : If you want to show CatalogItem1 to the users who are in location1 then add the “Available for location” embedded list to your form layout and in the list select location1.
Similarly if you do not want to show the catalog item to particular user based on their company, department, location and group then you can add the below list to your form and populate them according to your requirement.
Embedded List Visiblity Based on Not available for company Company Not available for department Department Not available at location Location Not available for group Group Not available for user User
- Go to the maintain item module available under the service catalog application and personalize the maintain item form. To personalize the maintain item form.
If you want to control the catalog item based on the roles then personalize you form layout and add the field “Roles” to your maintain item form and the required roles to the catalog item whose visibility you want to control based on the roles.
If the above solution does not satisfy your requirement then you can put the logic in entitlement script field available on the maintain item form.
In Fuji and post releases
In Fuji release ServiceNow has added a feature User criteria. Based on the user criteria you can control the catalog items as well as the knowledge articles. To get more details about the user criteria you can check the below servicenow wiki link.