It's all about the answers!

Ask a question

Get Repository Permissions for logged in user via RTC API


0
1
Marko Tomljenovic (3163582) | asked Apr 18 '16, 10:30 a.m.
Hi,
for some reporting purposes I would like to fetch via API the repository permissions that a logged in user (in the teamrepository object) currently has.

This code (which I adapted a little bit) only works if the user is JazzAdmin
http://www.joshuabambrick.com/assign-repository-permissions-rtc/

If the user is not JazzAdmin then a call to ExternalUserRegistryManager.fetchGroupsForUser(...) throws an exception, and not even the PermissionDeniedException (like described in the Javadoc) but a ServiceMethodInvocationError.

Any ideas how to solve this? Java API would be preferred but REST calls would also be ok.

Thank you

Comments
Marko Tomljenovic commented Apr 18 '16, 10:36 a.m.

 Also this post did not help: https://jazz.net/forum/questions/157888/how-to-get-repository-permissions-of-user-in-rtc-using-plain-java-api


For both solutions I need to have JazzAdmin permissions.

Accepted answer


permanent link
Marko Tomljenovic (3163582) | answered May 03 '16, 4:19 p.m.
 As it seems using ..userRegistryManager.isMember() throws an exception even if I am querying for data about the currently logged in user.
But if I use ...userRegistryManager.fetchGroups I get all the groups for the currently logged in user (wo having JazzAdmin permissions)
Ralph Schoon selected this answer as the correct answer

Your answer


Register or to post your answer.