Condition on Service Portal Menu Item to only show to users with Roles?

Wendy Peterson
Giga Guru

I have a menu item i need to put a condition on that only shows to users with Roles it doesn't matter the role they just have to have them. Any ideas on what that condition would be? TIA

1 ACCEPTED SOLUTION

Try: gs.getUser().getUserRoles().toArray().length>0


Raghav
MVP 2023

View solution in original post

4 REPLIES 4

RaghavSh
Kilo Patron

Use the below condition as per your requirement

 

gs.hasRole('itil')||gs.hasRole('itil_admin')

find_real_file.png


Raghav
MVP 2023

How would I change that to "Any Role" we have to many to list out. It's a menu item that links back to the client side away from our portal we only show to Users with Roles. TIA

Try: gs.getUser().getUserRoles().toArray().length>0


Raghav
MVP 2023

That worked Thank You