- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-22-2023 10:59 PM
Hi is it possible to check if a admin has for example the Security Admin Role active?
I want to hide a Modul for admins, if they are not elevate at security admin
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-22-2023 11:28 PM
Hi @Meloper ,
In sys_user_has_role table you can find the users who has Security Admin role active.
In server side scripts you can write gs.hasRole("security_admin") to check whether a user has security admin role or not
In client side scripts you can write g_user.hasRole("security_admin") to check whether a user has security admin role or not
g_user.hasRoleExactly() and gs.hasRoleExactly() as well available at client and server side.
Please mark correct if my response has solved your query.
Cheers,
Mohammed Basheer Ahmed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-22-2023 11:51 PM
Hi @Meloper ,
As i mentioned on my previous answer, there is no feasible option to do so. Also, it's not recommended.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-24-2024 12:10 AM - edited ‎10-24-2024 12:11 AM
g_user.hasRoleExactly() and gs.hasRoleExactly() documentation does not indicate that this is available on a server side, and from testing gs.hasRoleExactly() in a background script - it returns undefined.