- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2022 03:22 AM
Hello everyone ,
I need to create one ACL with delete operation for table with following condition :-
1 . If they are member of this group "Help Desk"
2. they have "u_help_desk" role .
Kindly suggest me solution for this with best practice .
Thanks in advance !!
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2022 04:47 AM
Hi ,
Please use this code :-
var abc = gs.getProperty('property name');
gs.log(' value is '+ abc);
if(gs.getUser().isMemberOf(abc) || gs.hasRole('sla_admin')) {
answer = true;
}else{
answer = false;
}
Kindly mark it as helpful or correct .
Regards,
Akanksha
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2022 04:53 AM
It's recommended not to hard-code names or sys_ids
you can create system property of type string and store group name in it
then use that
answer= gs.getUser().isMemberOf(gs.getProperty('propertyName')); // give name of property here
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader