- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-19-2022 06:33 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-19-2022 11:16 AM
From the client-side, you will have access to the g_user object. The methods which might help you are:
- hasRole
- hasRoleExactly
Here's some links which might help you.
https://servicenowguru.com/scripting/user-object-cheat-sheet/
https://developer.servicenow.com/dev.do#!/reference/api/quebec/client/c_GlideUserAPI?navFilter=glideuser
Otherwise, you will need to do a GlideAjax call or use g_scratchpad to make it available from the server-side to the client-side.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-19-2022 07:00 AM
Hi Saran,
I'm not getting your exact requirement. Can you please elaborate more?
Regards,
Gunjan Kiratkar
Consultant - ServiceNow, Cloudaction
Rising Star 2022
Please Mark My Response as Correct/Helpful based on Impact
Regards,
Gunjan Kiratkar
2X ServiceNow MVP
Community Rising Star 2022
Youtube : ServiceNow Guy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-19-2022 07:01 AM
Do you want to fetch all the roles the caller has?
If yes then after fetching where do you want to display them?
Regards,
Gunjan Kiratkar
Consultant - ServiceNow, Cloudaction
Rising Star 2022
Please Mark My Response as Correct/Helpful based on Impact
Regards,
Gunjan Kiratkar
2X ServiceNow MVP
Community Rising Star 2022
Youtube : ServiceNow Guy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-19-2022 09:00 AM
Whether you're trying to find out if the user has a specific role or just trying to get all of the caller's roles, you'll need a GlideAjax call for this. You'll need a client-callable Script Include that searches the sys_user_has_role table for any Roles associated with the caller's sys_id. You'll then call that Script Include from a Client Script using GlideAjax and do what you would like with the values returned.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-19-2022 07:21 PM
can you give me the exact script include script for this requirement.