get current login user role in client script

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-28-2022 08:58 PM
how get user role in client script, thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-28-2022 09:01 PM
You have two functions that will tell user has role or not.
g_user.hasRole('itil');
g_user.hasRoleExactly('itil');

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-28-2022 09:17 PM
can it using in widget, thanks you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-28-2022 09:18 PM
Hi,
you want to know all roles of logged in user at client side?
what's your business requirement?
you can check if logged in user has particular role or not in client script
g_user.hasRoleExactly('roleName');
Regards
Ankur
Ankur
⨠Certified Technical Architect || ⨠9x ServiceNow MVP || ⨠ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-28-2022 09:22 PM