ACL for assignment_group.parent members
						
					
					
				
			
		
	
			
	
	
	
	
	
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
09-23-2019 02:14 AM
Hi community!
We have a requirement to allow read access to incidents for user who opened it, are the caller of record, are on the watch list or belongs to the parent of the assignment_group.
We have the following ACL condition:
if (current.opened_by == gs.getUserID() || current.caller_id == gs.getUserID() || current.watch_list.indexOf(gs.getUserID()) > -1 || gs.getUser().isMemberOf(current.assignment_group.parent)) {answer = true;}
else {answer = false;}
But the last condition is not working (the underlined one), so user who belongs to the parent of the assignment_group are not able to read incident records.
Any idea about what is wrong on the script condition?
Regards!
- Labels:
 - 
						
							
		
			Best Practices
 - 
						
							
		
			Scripting and Coding
 
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
09-23-2019 02:34 AM
Hi,
Use the last condition as below
gs.getUser().isMemberOf(current.assignment_group.parent.getDisplayValue()))
-Anurag
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
09-23-2019 05:13 AM
Thank you Anurag! But unfortunatelly it doesn't seems to work either...
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
09-24-2019 01:14 AM
The parameter to pass inside the function isMemberOf() is the group name. The value of current.assignment_group.parent is the sys_id of the parent support group. So you will have to dot walk till the group name in order for this to work.
So, please use gs.getUser().isMemberOf(current.assignment_group.parent.name)
NOTE: Display Value can be configured to be just group name or combination of name and other values like Manager. So it is not recommended to use field_name.getDisplayValue() on Reference field, as group membership check requires the exact group name.
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
09-24-2019 08:28 AM
I've tried gs.getUser().isMemberOf(current.assignment_group.parent.name) and gs.getUser().isMemberOf(current.assignment_group.parent.name.toString()) but no luck...
