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!