It's all about the answers!

Ask a question

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

Richar Cai (1711016) | asked Feb 06 '17, 3:24 a.m.

 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:


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);
   return userRoles;
  for (IRole irole : icbtorRoles) {
   IRole2 role = (IRole2)irole;
  return userRoles;

Anybody has any idea?
Thank you very much!

Accepted answer

permanent link
Ralph Schoon (63.0k33645) | answered Feb 06 '17, 4:39 a.m.

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

You can try 

Richar Cai selected this answer as the correct answer

Richar Cai commented Feb 06 '17, 5:09 a.m.

 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 to post your answer.