Exclude members of a group from User Criteria
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2023 02:13 AM
Hi all,
We have a category on our Service Portal which uses a User Criteria to ensure it is not available to users of a certain Company. However we have a need to update this criteria to exclude users that are in this Company but are also members of a certain user group.
I have tried to add a script to the User Criteria to check the current users group and return as false if they're a member of the group but as you can guess this doesn't seem to be working. Is my script sound or is it a limitation that I wont be able to work around?
function checkGroup() {
var retVal;
var currentUser = gs.getUser();
if (currentUser.isMemberOf("Tech IAM team")) {
retVal == false;
}else{
retVal == true;
}
return retVal;
}
checkGroup();