It's all about the answers!

Ask a question

how to get repository permissions of user in RTC using plain java api


0
1
Vijay Reddy Gaddam (561841) | asked Jul 10 '14, 12:46 a.m.
 Hi,

In RTC we are having repository permissions (JazzAdmins,  ) for a user. I wanted to get all repository permissions assigned for user using Java API. These report is necessary for me in RTC license management. Can some one help me out. I was able to get the licenses assigned for a user with following:
 ist<IContributor> contributors = teamRepository.contributorManager().fetchAllContributors(monitor);
ILicenseAdminService licenseService = (ILicenseAdminService) ((TeamRepository)teamRepository).getServiceInterface(ILicenseAdminService.class);
IContributorLicenseType[] licenseTypes = licenseService.getLicenseTypes();
String[] assignedLicenseIds = licenseService.getAssignedLicenses(contributors.get(i));.

Now I need to get the repository permissions which could not get. I tried multiple option but failed to retireve. Can you help me out.

Thanks and Regards,
Vijay Reddy.

Accepted answer


permanent link
Susan Hanson (1.6k2173193) | answered Jul 10 '14, 6:02 a.m.
Our users are in an External User Registry (LDAP), and I get them this way:

        IExternalUserRegistryManager ieurm = teamRepository.externalUserRegistryManager();
        List<String> groups;

                groups = Arrays.asList(ieurm.fetchGroupsForUser(userid, monitor));

Vijay Reddy Gaddam selected this answer as the correct answer

2 other answers



permanent link
Eric Jodet (6.3k5101120) | answered Jul 10 '14, 3:58 a.m.
JAZZ DEVELOPER
 Hello,
I think this article http://www.joshuabambrick.com/assign-repository-permissions-rtc/
might help you.

Eric

Comments
Vijay Reddy Gaddam commented Jul 10 '14, 6:46 a.m. | edited Jul 10 '14, 6:48 a.m.

 It was very helpful. Thank you Eric.


permanent link
Vijay Reddy Gaddam (561841) | answered Jul 10 '14, 6:47 a.m.
edited Jul 10 '14, 6:58 a.m.
 Finally solution I made is:

IExternalUserRegistryManager userRegistryManager = teamRepository.externalUserRegistryManager();
IExternalGroup[] externalGroups = userRegistryManager.listApplicationGroups(null);
for (IExternalGroup iExternalGroup : externalGroups) {
if(userRegistryManager.isMember(contributors.get(i).getUserId(), iExternalGroup.getName(), monitor)){
System.out.print("\t - " + iExternalGroup.getName());
}
}

Your answer


Register or to post your answer.