Ismemberof is not working in scoped app
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2023 03:53 PM
Hi Community
A field should be editable to the members of the Assignment group(assignment group backend value = network_security_group) . I wrote the below mentioned code on a Field level Write ACL but it is not working. Can you please take a look and let me know where am I going wrong ?
The first 2 conditions are working but the 3rd condition for "ismemberof" is not working.
Quick question - "ismemberof" doesnot work in scoped app ??
if (gs.hasRole('x_cld_fsg.FSG_CLD_SECURITY') || current.network_iga_contact == gs.getUserID() || gs.getUser().isMemberOf(current.network_security_group.getDisplayName().toString())) {
answer = true;
} else {
answer = false;
}
Thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2023 07:58 PM
try this
I assume network_security_group field holds group name or group sysId
if (gs.hasRole('x_cld_fsg.FSG_CLD_SECURITY') || current.network_iga_contact == gs.getUserID() || gs.getUser().isMemberOf(current.network_security_group)) {
answer = true;
} else {
answer = false;
}
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
06-29-2023 06:18 AM
Network Security Group (network_security_group) holds the group name. Whatever the group that is assigned on the "Network Security Group" field, members of that field should have "Write" Access.
I have tried with the code that you have shared, it didn't worked.
Is there any other way that we can implement this ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2023 07:02 AM
that field holds only 1 group name right?
ACL script looks fine.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2023 07:13 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2023 07:22 AM
Is there any cross scope privilege that I need to enable or any config change that is missing ?