Skip to main content
8-Gravel
December 10, 2024
Solved

Is there any API to get the roles of a User?

  • December 10, 2024
  • 1 reply
  • 1031 views

Is there any API to get all the roles of a specific user?

Best answer by avillanueva

If you are referring to roles like in contexts like Projects, Libraries and Product areas, yes. Its a bit more complicated but each Role you see is actually a group so just WTGroup, or a group of a group. This was my Query Builder report to figure out the relationships. Starting with the Team (wt.inf.team.ContainerTeam), this is the main list of "Roles" for a context. That is linked to a groups (G1) via a RolePrincipalMap object. Finally the group which shares the same name as the role (CCB in my image which is a WTGroup), holds the list of users.

avillanueva_0-1733835305714.png

Its a bit complicated so you'll need a few APIs to get your answer.

1 reply

avillanueva
23-Emerald I
23-Emerald I
December 10, 2024

If you are referring to roles like in contexts like Projects, Libraries and Product areas, yes. Its a bit more complicated but each Role you see is actually a group so just WTGroup, or a group of a group. This was my Query Builder report to figure out the relationships. Starting with the Team (wt.inf.team.ContainerTeam), this is the main list of "Roles" for a context. That is linked to a groups (G1) via a RolePrincipalMap object. Finally the group which shares the same name as the role (CCB in my image which is a WTGroup), holds the list of users.

avillanueva_0-1733835305714.png

Its a bit complicated so you'll need a few APIs to get your answer.

Marco Tosin
21-Topaz I
21-Topaz I
December 11, 2024

@avillanueva
could you please share your report?

 

Following your directions I am a little bit in trouble to recreate it in my system.

 

Thank you

 

Marco
avillanueva
23-Emerald I
23-Emerald I
December 11, 2024

Zipped QML loaded. You can remove any of the conditions  that do not apply for you.