- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
can anyone please tell me why gs.hasRole('anyrole') is giving true for the admin and not for the other and also how to override this case that it must apply for admin too can we actually do that ?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Jagadeesh_Maddi ,
yes it's returns true for admin even when the role doesn't exist and it's the expected behaviour
GlideSystem - Global--> User has at least one of the passed-in roles. Also returns true if the user has the administrator role.
to check if the user actually have the role you can use this
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
Admin has other roles too so it returns true.
Server side we don't have gs.hasRoleExactly hence this cant be used.
Here is community answer which can be used as workaround:
Thanks and Regards,
Mohammed Zakir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
Admin has other roles too so it returns true.
Server side we don't have gs.hasRoleExactly hence this cant be used.
Here is community answer which can be used as workaround:
Thanks and Regards,
Mohammed Zakir
