how to get repository permissions of user in RTC using plain java api
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.
Vijay Reddy.
Accepted answer
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));
IExternalUserRegistryManager ieurm = teamRepository.externalUserRegistryManager();
List<String> groups;
groups = Arrays.asList(ieurm.fetchGroupsForUser(userid, monitor));
3 other answers
Having similar issue.
http://www.joshuabambrick.com/assign-repository-permissions-rtc/ is not a valid page
ANy other source?
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());
}
}