Find Users with a Role

We have custom Role Base Access Control (RBAC). I am able to find a specific role by using session.getAdminInstance().getNode(NodeConstants.NODE_ROLES) and performing getChildNode(“RoleName”). This gives me an IRole.

How do I then find all of the users under this role? It seems like a two fold issue, as I want all the Roles either directly on the User, or via a UserGroup membership. It appears the Administrator UI is able to easily obtain this information when you load a Role there is a Users and UserGroups tab. I am crossing my fingers that this information is somehow exposed through the common API.

Add Comment
1 Answer(s)
Best answer

Not sure if you can get the list of users/user-groups directly from the (ITree) IRole object, but as a workaround, once you have the name of the role, you could easily create two queries (1 for Users and 1 for User groups) who have that role listed in “General Info.Roles” .  For the User Group query, you would have to iterate through the results to get the user group object, and then its respective user table to display each user…

Agile User Answered on November 12, 2018.

This is exactly what I ended up doing. I’m marking you as the answer as it is correct.

on November 12, 2018.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.