Get user project area and role access using plain Java API - RTC
We have an Rational Team Concert instance with many different project areas and a user may have access to one or more of these project areas.
Using the plain Java API I would like to find all the project areas a specific user has access to and what roles they have assigned to them in each of those project areas. Initially I thought this might be quite simple but the only way I have found to do this is to dump every project area's users and roles and then sift through the output looking for the specified user. This was done with the help of the guide on this page. Is there a more simple and efficient way to obtain this information? Thanks for the help! |
Accepted answer
I think you would be able to do this:
Given that you have the IProcessItemService you can call
findProcessArea(IContributor user, IProjectAreaHandle projectAreaHandle, IProcessClientService.ALL_PROPERTIES, IProgressMonitor monitor)
You can get the IContributor by:
teamRepository.contributorManager().findContributorByUserId(userId) - will return IContributorHandle
Alex Lindley selected this answer as the correct answer
Comments 1
Yes, you are correct.
IContributor user = teamRepository.loggedInContributor(); IProcessItemService processItemService = (IProcessItemService) teamRepository .getClientLibrary(IProcessItemService.class); does provide the project areas where the user is member. |
3 other answers
Hi Anurag,
Thank you!
findProcessArea
seems to be exactly what I am looking for.
A slight amendment should anyone else want to use this, in the RTC 4 API you get the IContributor with: teamRepository.contributorManager().fetchContributorByUserId(user) |
Ralph Schoon (63.4k●3●36●46)
| answered Apr 08 '13, 11:57 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Hi Alex,
you want to start with this post: http://rsjazz.wordpress.com/2012/12/09/analyzing-a-aroject-areas-members-and-roles-using-the-plain-java-client-libraries/ there are several more that might be of interest. |
Hi Ralph,
I appreciate your quick response. That particular link is the one I mentioned in my post above, the example on that page seems to suggest that you should get all project areas and then dump the contents of each. I'm hoping to query RTC to find all project areas which a user has access too, avoiding the need to cycle through all project area users & roles to find what a particular user has.
If I'm missing something obvious in that example or if you have any other examples please let me know.
Thanks! |
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.