- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2021 09:00 PM
I am using below code in an ACL to give access if user is member of that group. I want to use sys id instead of name so change in group name doesn't affect the code. What would be the code?
if (gs.getUser().isMemberOf('Program Senior Managers'))
{
answer = true;
} else
{
answer = false;
}
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2021 09:20 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2021 09:16 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2021 09:20 PM
You can pass the sys_id also
gs.getUser().isMemberOf(<sys_id>)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2022 01:04 PM
Also, be sure the group you are checking is ACTIVE, otherwise the function will return false even though the user actually IS a member. This is very confusing. 😕

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2021 09:23 PM
FYI; gs.getUser().isMemberOf() works for both group name and group sys_id