how to restrict the catalog item to admins catalog item is visible to particular group

sajida3
Kilo Contributor

i have a requirement to restrict the catalog item to admins and need to visible that catalog item to particular group(secure group)

i am trying to do with the user criteria,Available for(in Available for i mention the group name)ang tag it to that catalog item

but it is not working could you please help me to resolve the issue

5 REPLIES 5

Musab Rasheed
Tera Sage
Tera Sage

Hi Sajida,

Can you show me user criteria you have defined.? In case you don't want admin to see you can add admin criteria to 'Not available for' as well. And for group 'Available for' should be sufficient. If you have configured it correctly and still not visible to mentioned group please try clearing cache or try in fresh browser. It should work. Mark my answer as correct or hit like based on impact.

Regards,

Musab

Please hit like and mark my response as correct if that helps
Regards,
Musab

Saurav11
Kilo Patron
Kilo Patron

Hello,

To do this you In the user criteria you can just add admin in the role tab and the group name in the group tab:-

find_real_file.png

In case if you have done the same and it is not working, please share the screenshot of your user critera.

 

Please mark answer correct/helpful based on Impact

can you please help me with these

 

https://community.servicenow.com/community?id=community_question&sys_id=68d6ca6bdba90910bb4a474d13961958

sajida3
Kilo Contributor

allow();

function allow() {

if (gs.getSession().isInteractive()) {
//if (gs.getUser().hasRole('maint') {
var gr = new GlideRecord('sys_user_has_role');
gr.addQuery('user', gs.getUserID());
gr.addEncodedQuery('role.nameINadmin,snc_internal');
// gr.addEncodedQuery('role.nameINadmin,snc_internal,sn_hr_sp.hrsp_released_country,sn_hr_sp.hrsp_employee,sn_hr_sp.hrsp_prioritised_country');
gr.query();
if (gr.next()) {
return false;
} else {

return true;

}

i tried this one also

if(gs.getUser().isMemberOf('CSIR secure group'))
{

answer = true;
}

else
{


answer = false;
}

 

plz try to help me