It's all about the answers!

Ask a question

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


Michael Payne (56175) | asked Oct 18 '11, 1:51 p.m.
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.

6 answers



permanent link
Michael Payne (56175) | answered Oct 18 '11, 2:26 p.m.
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.

permanent link
Michael Payne (56175) | answered Oct 24 '11, 1:55 p.m.
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?

permanent link
Jorge Diaz (8664434) | answered Nov 15 '11, 1:21 p.m.
JAZZ DEVELOPER
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.

permanent link
Qiong Feng Huang (76911610) | answered Nov 17 '11, 6:55 a.m.
JAZZ DEVELOPER
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?

permanent link
Andrew Freed (21311214) | answered Nov 28 '11, 10:00 a.m.
JAZZ DEVELOPER
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.

permanent link
Michael Payne (56175) | answered Nov 28 '11, 10:24 a.m.
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.

Your answer


Register or 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.