ACL for CI Ownership Groups

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2024 03:05 AM - edited 10-28-2024 03:08 AM
Hi,
I have a scenario where I have to give access to the ownership groups in CI through ACL. Kindly help.
This is what I have done currently. I completed for the single users. The group names below are not in the group name as is, so I can't find them. The first group is servicenow_admin, so we hardcoded it.
if (gs.getUser().isMemberOf('ad53348b874a0510b2bab996cebb35b5') || gs.getUserID()==current.u_it_manager || gs.getUserID()==current.
u_test_lead || gs.getUserID() == current.owned_by)
{
answer = true;
} else {
answer = false;
}
Regards
Suman P.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2024 06:37 AM
Hi @Community Alums ,
If it is not there in group table then first you have to create it and add code for those group as well.
gs.getUser().isMemberOf(group1) || gs.getUser().isMemberOf(group2) || gs.getUser().isMemberOf(group3);
-------------------------------------------------------------------------
If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.
Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay
-------------------------------------------------------------------------
You may use sysproperty to get the sys_if of group

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2024 11:41 PM
Hi @Runjay Patel,
This is what has worked.
var servicenow_admin_sys_id = 'ad53348b874b2bab996cebb35b5';
if (
gs.getUser().isMemberOf(servicenow_admin_sys_id) ||
gs.getUserID() == current.u_it_manager ||
gs.getUserID() == current.u_test_lead ||
gs.getUserID() == current.owned_by ||
gs.getUser().isMemberOf(current.u_business_owners_group) ||
gs.getUser().isMemberOf(current.change_control) ||
gs.getUser().isMemberOf(current.support_group)
) {
answer = true;
} else {
answer = false;
}
Regards
Suman P.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2024 11:45 PM
HI @Community Alums ,
Cool, This what i had suggested you.
-------------------------------------------------------------------------
If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.
Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay
-------------------------------------------------------------------------