- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2024 08:22 AM - edited 08-07-2024 08:26 AM
Hi All
Looking to create a new user criteria so I can restrict visibility of a catalogue item I am building to just group managers.
Any guidance appreciated as ever.
Brad
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2024 08:39 AM
You could try something like this:
answer = checkCondition();
function checkCondition(){
var gr = new GlideRecord("sys_user_group");
gr.addQuery("manager", user_id); //Looks to see if this user is listed as a manager on any user record
gr.setLimit(1);
gr.query();
if(gr.hasNext()) //If the user is listed as a manager in a group
return true;
else
return false;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2024 08:39 AM
You could try something like this:
answer = checkCondition();
function checkCondition(){
var gr = new GlideRecord("sys_user_group");
gr.addQuery("manager", user_id); //Looks to see if this user is listed as a manager on any user record
gr.setLimit(1);
gr.query();
if(gr.hasNext()) //If the user is listed as a manager in a group
return true;
else
return false;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2024 09:00 AM
Thanks for your help, tested and working.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2025 09:50 PM
Hi what will be the best practice to make a catalog item visible for 200 user with no common attributes apart from snc_internal role?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2025 09:07 AM
Create a custom role and give that role to the users that should see the catalog item. Also could create a group with those users and base the user criteria on that.