Read current role

Hello everyone, is there such a thing as getCurrentUser() to read the role assigned to the logged in user? Something like getCurrentRole() :-)

Best regards
Vici

Yes, app.getCurrentUserRoles(), see https://opensource.hcltechsw.com/leap-doc/9.3.5/ref_application_object.html

Hi Vici,

Yes, you can use both method about it. Please refer to https://help.hcl-software.com/leap/9.3/ref_application_object.html

app.getCurrentUserRolesReturns a comma-separated list of all the roles for which the current user is a member.
app.isCurrentUserInRole(roleName)Returns true if the current user is a member of the provided role, otherwise false.

For example:

alert(app.getCurrentUserRoles()); // ie. displays Administrator, Initiator 

alert(app.isCurrentUserInRole("Manager")); //ie. displays true or false

Hope this helps.

Thanks,

Jayve