Check for elevated role

Meloper
Kilo Sage

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

1 ACCEPTED SOLUTION

Basheer
Mega Sage

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 hit like button if my suggestion has helped you in any way.
Please mark correct if my response has solved your query.

Cheers,
Mohammed Basheer Ahmed.

View solution in original post

6 REPLIES 6

Community Alums
Not applicable

Hi @Meloper ,

 As i mentioned on my previous answer, there is no feasible option to do so. Also, it's not recommended.

 

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.