ACL

sparkles
Tera Contributor

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)

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@sparkles 

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.

 

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

karthiknagaramu
Kilo Sage

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

it didn't work