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

Not all roles are being returned for a member in a sub team

I noticed sometimes we are not getting all the roles assigned to a user in a team area. It seems to happen when the user is a member of a team area that is a child of another team area. A user may be assigned all the roles, but only 2 of of the roles are returned. This doesn't happen in all cases so I'm not sure exactly what triggers it.

I've noticed this on Rational Team Concert version 2.

Here's a code snippet to get the user's roles:


IProcessItemService service= (IProcessItemService) repo.getClientLibrary(IProcessItemService.class);
IProcessAreaWorkingCopy areaWC = (IProcessAreaWorkingCopy) service.getWorkingCopyManager().createPrivateWorkingCopy(processArea);
ITeamWorkingCopy teamWC = areaWC.getTeam();
IRole[] roles = teamWC.getRoleCast(contributor);


Any help would be greatly appreciated.

0 votes



6 answers

Permanent link
I changed the code to

IClientProcess clientProcess = service.getClientProcess(processArea, null);

IRole[] roles = clientProcess.getContributorRoles(contributor, processArea, new NullProgressMonitor());


and it seems to be working now.

0 votes


Permanent link
I still see issues getting the right roles for a user. I am now seeing when I have a project area with two team areas and one of the team areas has child team area, I sometimes don't get the right roles for a member in a team area.

This time I'm seeing extra roles being returned for a user in a team area.

Here is the layout of the project/area team roles on RTC:

-Superman
--Superman
---Engineer, Superman
--Engineer

The code returns:
-Superman
--Superman
---Engineer, Superman
--Engineer, Superman

So when I call to get the users role in the last team area, is the code returning roles for both the team area and the project area? Is there a way to get the roles just in the team area?

0 votes


Permanent link
Hello Michael,

you should have a look at:

http://jazz.net/library/article/292

I think what you see is consistent with the behavior described.

Regards,

Jorge.

0 votes


Permanent link
I still see issues getting the right roles for a user. I am now seeing when I have a project area with two team areas and one of the team areas has child team area, I sometimes don't get the right roles for a member in a team area.

This time I'm seeing extra roles being returned for a user in a team area.

Here is the layout of the project/area team roles on RTC:

-Superman
--Superman
---Engineer, Superman
--Engineer

The code returns:
-Superman
--Superman
---Engineer, Superman
--Engineer, Superman

So when I call to get the users role in the last team area, is the code returning roles for both the team area and the project area? Is there a way to get the roles just in the team area?


This is expected that you will get the role assignments from the given area as well as role assignments defined in parent areas. This is how we control the permission and operation behavior based on role assignments.

Can I ask the reason why you need to get the roles only defined in the given area programmatically?

0 votes


Permanent link
Can I ask the reason why you need to get the roles only defined in the given area programmatically?


We are building a management UI on top of RTC and other applications that needs to be able to assign roles to new and existing users.

0 votes


Permanent link
I reverted the code back to what I posted at the top. This gives me the roles assigned for the member of the project/team area. However, I don't always get all the roles assigned. I witnessed when a member is assigned multiple roles, I would only receive one of the roles. I wasn't able to pin down the exact scenario that causes this. If I were to assign the roles again either in our UI or in RTC UI, then all the assigned roles are returned as expected.

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

Question asked: Oct 18 '11, 1:51 p.m.

Question was seen: 6,610 times

Last updated: Oct 18 '11, 1:51 p.m.

Confirmation Cancel Confirm