- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2021 03:37 AM
Hi all,
I have an ACL that restricts certain field so it is only visible to change management.
This works, however the admins (including me) could see the field restricted to the change_manager role, even though the admin overrides is unticked.
I read on a thread that if i use the below script it will then only show for users with that role.
However now, the field isnt showing for anyone, even users with change_manager role.
if (gs.getUser().isMemberOf('change_manager')) {
answer = true;
}
else {
answer = false;
}
what am i doing wrong here?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2021 03:57 AM
If you need them to have a specific role and not be admin you can do the following:
if (!gs.hasRole("admin") && gs.hasRole("change_manager")) {
answer = true;
}
else {
answer = false;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2021 03:47 AM
iMemberOf is used to check if a user is a member of a group not necessarily if they have a role, and you need to pass in the sys_id of the group. Roles should be applied to groups, not users anyway, so make sure your change management team members are in a group that has this role, then use the group sys_id in this ACL script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2021 03:57 AM
If you need them to have a specific role and not be admin you can do the following:
if (!gs.hasRole("admin") && gs.hasRole("change_manager")) {
answer = true;
}
else {
answer = false;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2021 04:05 AM
Hi
Are you working in scoped application ??
Please refer below thread
Please mark correct/helpful, If you find any help