UI Action Visibility

eswarijk
Tera Contributor

I have a UI Action in Incident form

I want the UI Action to be only visible to users having itil role

So I restricted the UI Action visibility by mention the condition field as gs.hasRole('itil')

But the UI Action is visible to admin users also..

Whether all the UI Actions are visible to all admin role users..?

1 ACCEPTED SOLUTION

Chuck Tomasi
Tera Patron

Hi Eswari,



In general, admin role includes all other roles. If you use gs.hasRole("itil"), your admins will see this also. It's just how the system works.



Base System Roles - ServiceNow Wiki


View solution in original post

7 REPLIES 7

Chuck Tomasi
Tera Patron

Hi Eswari,



In general, admin role includes all other roles. If you use gs.hasRole("itil"), your admins will see this also. It's just how the system works.



Base System Roles - ServiceNow Wiki


Thanks for your clarification


You are welcome.



If I have answered your question, please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.



If you are viewing this from the community inbox you will not see the correct answer button.   If so, please review How to Mark Answers Correct From Inbox View.



Thank you


Anurag Tripathi
Mega Patron
Mega Patron

Hi,



You can use hasRoleExactly here to achieve this.



g_user.hasRoleExactly()True if the current user has the exact role specified, false otherwise, regardless of 'admin' role.


Usage: g_user.hasRoleExactly('itil')


GlideUser (g user) - ServiceNow Wiki


-Anurag