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

How to get exactly roles for a RTC user within the exactly team area

 Dear Team,


I am writing to seek your help for RTC api question.
I tried to use RTC server java api to get the roles for a user within a team area, but the result wasn't expected.

We have the project area and team area structure as below:

Sample_Project_Area
              |Product_A_Control_Team
                                    |Sub_Dev_Team

For example:
User AA in "Product_A_Control_Team" has "developer role", and in "Sub_Dev_Team" has "guest role".
The expected result is if I fetch User AA's role within Sub_Dev_Team, it should return only "guest role" but not "developer role" and "guest role".
It seems the server api has some problem. When we try to fetch the exactly role for the sub_teamarea, the api will get all the roles the RTC User has in both sub_teamarea and it's parents teamareas.

The Server API we used is as below:
I am sure parameter of processArea we passed into is the sub teamarea ("Sub_Dev_Team").
============================
private List<String> getUserRoleList(IContributorHandle userHandle, IProcessArea processArea) throws TeamRepositoryException {
  IServerProcess serverProcess = getService(IProcessServerService.class).getServerProcess(processArea);
  //角色列表
  List<String> userRoles = new ArrayList<String>(); 
  IRole[] icbtorRoles = serverProcess.getContributorRoles(userHandle,processArea);
  
  if(icbtorRoles==null){
   return userRoles;
  }
  for (IRole irole : icbtorRoles) {
   IRole2 role = (IRole2)irole;
   userRoles.add(role.getId());
  }
  return userRoles;
 }

Anybody has any idea?
Thank you very much!

0 votes


Accepted answer

Permanent link

 As discussed try to search (Java) for method role.

You can try com.ibm.team.process.common.IProcessArea.getRoleAssignmentIds(IContributorHandle) 

Richar Cai selected this answer as the correct answer

0 votes

Comments

 Dear Ralph,


Thank you so much for your kind advice and help.
The API, It works for us.

Thanks&Best regards,
Richar Cai

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
× 10,938

Question asked: Feb 06 '17, 3:24 a.m.

Question was seen: 2,554 times

Last updated: Feb 06 '17, 5:09 a.m.

Confirmation Cancel Confirm