Check if a user for a given userID has snc_internal role from scoped application
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-06-2025 09:53 PM
In global application scope, we can check if a user has a role using the below API:
new GlideUser().getUserByID(userId).hasRole(roleName)
But for scoped applications, i'm not able to find a similar method. For a given userID and in my application scope, i want to check if it has snc_internal role or not?
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-09-2025 11:19 PM
it's not supported, so the only option is to query sys_user_has_role table
If my response helped please mark it correct and close the thread so that it benefits future readers.
Regards,
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader