Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

Context Menu

monu1
Giga Contributor

What condition shall I put on VIEW context menu so that admin can see the view but itil cannot.

Actually admin has itil role by default.

Please do answer the condition .

Thank you

1 ACCEPTED SOLUTION

amlanpal
Kilo Sage

Hi Manisha,



The condition should be as of below. You just need to add the bold portion.


ListProperties.canChangeView() && gs.hasRightsTo('ui/context_menu.view/read', null) && gs.hasRole("admin")



I hope this helps. Please mark correct/helpful based on impact


View solution in original post

8 REPLIES 8

anjalichoudhary
Kilo Guru

Hi Manisha,



You can try by putting below condition:



gs.hasRole("admin")



Regards,


Anjali


snehabinani26
Tera Guru

Hi Manisha,



I dont think there is any problem if admin user has ITIL role. Problem arises when ITIL contains Admin role.



Not sure what is your requirement here.



Please elaborate.


Not applicable

Ankur Bawiskar
Tera Patron

Hi Manisha,



What is the name of the context menu you want to show/hide based on role?


Can you explain your requirement in details?



Regards


Ankur


Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 10x ServiceNow MVP  ||  ✨ ServiceNow Community Leader