Hide menu item on menu icon list (on service portal) if user is in a particular group

sarahleighton
Tera Contributor

Hi all

 

On the icon menu list on our service portal, we are able to specify conditions for each menu item, to dictate who we show the item to, by using isMemberOf(group name) to only show the item to those in that group.

But how can we hide an item based on users being in that specific group? I want to specify which groups to hide it for instead of show it for, because the rest of the organisation have no groups or roles, so I can't use 'isMemberOf(group name)' to specify who we want to show it to.

I've tried -

isNotMemberOf(group name)

!=isMemberOf(group name)

It doesn't seem that the form configuration on the backend has 'available for' or 'not available for' either.

 

Is there a way to do this?

Many thanks.

Sarah

1 ACCEPTED SOLUTION

Anirudh Pathak
Mega Sage

Hi, 

In the Menu Item record "condition" field you can use: !gs.getUser().isMemberOf('sys_id of the group')

View solution in original post

4 REPLIES 4

Anirudh Pathak
Mega Sage

Hi, 

In the Menu Item record "condition" field you can use: !gs.getUser().isMemberOf('sys_id of the group')

Well that was simple! Thank you. Do you know if it's possible to do the same thing on an icon link widget? There doesn't seem to be a 'conditions' field?

 

Thanks!

Hi @sarahleighton,

There is a role field available, you can try adding the roles to whom you want to give access.

Hi - I saw that but the people I want to restrict it from are the same as in the above case, and don't have any roles. I don't want to give any roles as it impacts other functionality. I was hoping there was a way to add the same condition as above. I'll keep trying. Thanks