Regarding catalog item
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a month ago
I created a catalog item and in user criteria, i have mentioned the department to which then catalog item should be visible. It is visible to the department members and also admins. Cant we restrict admins here?
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a month ago
why would admins raise request?
Currently your user criteria will be satisfied when admins belong to that department
The only way is use advanced script
if (gs.hasRole('admin'))
answer = false;
else {
var gr = new GlideRecord("sys_user");
gr.addQuery("sys_id", user_id);
gr.addQuery("department.name", "ABC");
gr.query();
answer = gr.hasNext();
}
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Regards,
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader