In ServiceNow, the admin role includes all other roles implicitly. So if a user has admin, g_user.hasRole('any_role') returns true.
From ServiceNow Docs – g_user API:
“The hasRole() method returns true if the user has the specified role or is an admin.”
Contribute your Thoughts:
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit