ACL

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2023 06:00 AM - edited 09-05-2023 04:13 AM
Good day!
I need is to create ACL where user can see only tickets assigned to the group he is member of. I have 3 groups (Eastdpt), (Westdpt) and (National). Currently all groups have access to each other's tickets. I need ACL that allow (National) to see both Region’s tickets, (westdpt) to see the West Region’s tickets and (eastdpt) to see the East Region’s ticket. It’s a custom table and the sys user role is x_acc_region_.acc_user
Eastdpt and Westdpt are assignment group but National is a security group(super user)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2023 06:03 AM
you can keep existing table level READ ACL as it is.
Use query business rule on that table
I hope your table has a group field which stores reference to group
(function executeRule(current, previous /*null when async*/) {
// Add your code here
if(gs.getUser().isMemberOf('Esatdpt Group'))
current.addQuery('groupField.name', 'Esatdpt Group');
else if(gs.getUser().isMemberOf('Westtdpt Group'))
current.addQuery('groupField.name', 'Westtdpt Group');
})(current, previous);
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2023 06:03 AM
Hi,
You can create one ACL which can execute the below script to provide access.
var currentUser = gs.getUser();
if(currentUser.isMemberOf(assignment_group_field)) // here replace with the actual field name
return true;
else
return false;
Regards,
Karthik Nagaramu

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2023 04:13 PM
it didn't work