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 ,

There are only two ways I know of OOTB. First is set active to false, which does not work for you.  The second is if its a scoped app that has "Application administration" set to true.

 

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.

Hi, do you already know how i can select that a role has to be elevated?
Like teh sec admin role.
Can i do this with a custom role also? That an admin has to elevate as this role?

Generally Security Admin role is only provided for the users with Admin role.

I don't think it is possible through custom role as per my knowledge.

 

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.