How to check what roles were assigned to a user?

Archana Singh1
Tera Expert

Hello,

By mistake one of our colleagues has removed the roles for a user. The roles removed were non-admin roles hence not inherited.

Is there any way by which we can know what roles were assigned to a user ?

Please help !

Thanks in advance.

Archana

1 ACCEPTED SOLUTION

Govind Kumar S1
Kilo Guru

Hi archana,



You can restore the roles assigned to user by following this path.



Go to deleted records as shown below :



find_real_file.png



click on Button Record.



find_real_file.png



Regards,


Govind Sharma


View solution in original post

2 REPLIES 2

Govind Kumar S1
Kilo Guru

Hi archana,



You can restore the roles assigned to user by following this path.



Go to deleted records as shown below :



find_real_file.png



click on Button Record.



find_real_file.png



Regards,


Govind Sharma


IamAmolB
Tera Guru

Hi Archana,




You can write var ourUser = gs.getUser();   it will return you user object




gs.getUser().getUserRoles(); it will return the all rols which are granted to the user




gs.getUser().hasRole()     returns true or false if the current user has the provided role (takes a role name as its argument)




gs.getUser().isMemberOf()       -- returns true or false if the current user is a member of the provided group (takes a group name or sys_id as its argument). isMemberOf() returns false if the group is inactive, even if the user is a member.






Hope it will help you.




Please mark answer as correct answer if it helps you