- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2021 12:49 AM
I want to create an ACL for cmdb_ci_server table so that for a field, for which I need to restrict visibility so some users and groups will be able to see that field. So How can I create script in ACL to add this users and groups ?
Thanks in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-06-2021 11:40 PM
Hi,
So it should be shown when logged in user is member of CAB Approval or that logged in user is present in list of sys_ids in that system property
Is that system property holding multiple user sys_ids with comma separation
then update as this
answer=false;
if(gs.getUser().isMemberOf('CAB Approval') || gs.getProperty('cmdb_ci_server.os.user.visibility').indexOf(gs.getUserID()) > -1 )
{
answer=true;
}
else{
answer=false;
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2021 11:45 PM
Hi Nikita,
Did you get a chance to check this script
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-06-2021 01:35 AM
Hi Ankur,
I have tried your solution, but still some other users are able to see that field on list view. dont know is it happening due to some role or something else
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-06-2021 01:40 AM
Hi,
Please share your ACL configuration and are you testing with correct users?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-06-2021 11:26 PM
Hi Ankur, I am using below script in Advance section of ACL
answer=false;
if(gs.getUser().isMemberOf('CAB Approval') ||gs.getUserID() == gs.getProperty('cmdb_ci_server.os.user.visibility') )
{
answer=true;
}
else{
answer=false;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-06-2021 11:40 PM
Hi,
So it should be shown when logged in user is member of CAB Approval or that logged in user is present in list of sys_ids in that system property
Is that system property holding multiple user sys_ids with comma separation
then update as this
answer=false;
if(gs.getUser().isMemberOf('CAB Approval') || gs.getProperty('cmdb_ci_server.os.user.visibility').indexOf(gs.getUserID()) > -1 )
{
answer=true;
}
else{
answer=false;
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader