Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X
Hi.
I add user to the document team like this:
WTDocument wtd = ...;
Team docTeam = (Team)(wtd.getTeamId()).getObject();
docTeam.addPrincipal(Role.toRole("ASSIGNEE"), as);
User added successfuly, but he don't have permissions for modifying this document. If add user on the same role by wizard everything is nice.
Maybe I should refresh something else?
Solved! Go to Solution.
Try TeamHelper.service.augmentRoles for permissions and new assignments, or LifeCycleHelper.service.augmentRoles(pbo) for just permissions.
WTDocument pbo = ......;
WTPrincipal principal = .....;
Role role = .....;
Team team = ......;
TeamHelper.service.addRolePrincipalMap(role,principal,team);
TeamHelper.service.augmentRoles(pbo, TeamReference.newTeamReference(team));
Try TeamHelper.service.augmentRoles for permissions and new assignments, or LifeCycleHelper.service.augmentRoles(pbo) for just permissions.
WTDocument pbo = ......;
WTPrincipal principal = .....;
Role role = .....;
Team team = ......;
TeamHelper.service.addRolePrincipalMap(role,principal,team);
TeamHelper.service.augmentRoles(pbo, TeamReference.newTeamReference(team));
Thanks Matthew! Love your answers. They are contains directly what I need to reach the result.