Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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!

0 votes


Accepted answer

Permanent link
 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

3 votes

Comments

Yes, you are correct.

        IContributor user = teamRepository.loggedInContributor();
        IProcessItemService processItemService = (IProcessItemService) teamRepository
                .getClientLibrary(IProcessItemService.class);

    List processAreasOfUser= processItemService.findProcessAreas(user, null, IProcessClientService.ALL_PROPERTIES , monitor);


does provide the project areas where the user is member.

1 vote


3 other answers

Permanent link
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)


1 vote

Comments

Hi Alex, Anurag, thanks for the inspiration, I updated the blog post with the snippet.

1 vote


Permanent link
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.

0 votes


Permanent link
 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!

0 votes

Your answer

Register or log in to post 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 12,017
× 411
× 25
× 21
× 17

Question asked: Apr 08 '13, 11:50 a.m.

Question was seen: 14,240 times

Last updated: Apr 09 '13, 5:53 a.m.

Confirmation Cancel Confirm