- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2017 07:21 AM
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..?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2017 07:23 AM
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2017 07:23 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2017 08:17 AM
Thanks for your clarification

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2017 08:18 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2017 07:25 AM
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