How to add users and roles in child team area using plain Java RTC API?

自古美人都是妖i 提交于 2019-12-08 03:49:13

问题


Is it possible to add users and roles in child team area? My code currently can add users and roles in team areas but how can I add them in child team area.

ITeamArea TA = (ITeamArea)teamRepository.itemManager().fetchCompleteItem(newTAHandle,ItemManager.DEFAULT,monitor);
 IContributor contributor = teamRepository.contributorManager().fetchContributorByUserId(members,monitor);
 ArrayList roles  = getTeamRoleName(projectArea,member_roles);
 IProcessAreaWorkingCopy areaWc = (IProcessAreaWorkingCopy)service.getWorkingCopyManager().createPrivateWorkingCopy(TA);  
 areaWc.getTeam().addContributorsSettingRoleCast( new IContributor[] {contributor}, new IRole[] {roles})); 
 areaWc.save(null);

I was trying to find the hierarchy stuff, but then not finding the option of adding contributors to child team area.

IProjectArea workinCopyProjectArea = (IProjectArea) projectArea.getWorkingCopy();
            ITeamAreaHierarchy teamAreaHierarchy = (TeamAreaHierarchy) workinCopyProjectArea.getTeamAreaHierarchy();

回答1:


That projectArea.getWorkingCopy(); was described as not working in this thread.

While this was:

ProjectAreaWorkingCopy wc = new ProjectAreaWorkingCopy(projectArea);
wc.addMembers(c);


来源:https://stackoverflow.com/questions/18004211/how-to-add-users-and-roles-in-child-team-area-using-plain-java-rtc-api

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!