The CreatorCon Call for Content is officially open! Get started here.

Catalog Item Restriction

leviii
Tera Contributor

Hello, 

 

Can someone know how to restrict catalog item visibility? catalog item must be only visible specifically for users with authorization level 3 and above.  I already created a user criteria and attached it in my catalog item but it is still not working.

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@leviii 

please share your user criteria and script

Ensure you add that in "Available For" Related list of your catalog item

Script something like this, but please enhance

var userRec = new GlideRecord('sys_user');
userRec.addQuery('sys_id', user_id);
userRec.addQuery('u_authorization_leve', '3'); // give your proper query here
userRec.query();
answer = userRec.hasNext();

You can also test this using User Criteria Diagnostics

Debug user criteria of a catalog item 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

5 REPLIES 5

this help thanks man