cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

How to add user to the document team with the accsess refreshing?

SOLVED
AntonBagryanov
Visitor

How to add user to the document team with the accsess refreshing?

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?

1 ACCEPTED SOLUTION

Accepted Solutions

Re: How to add user to the document team with the accsess refreshing?

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));

View solution in original post

2 REPLIES 2

Re: How to add user to the document team with the accsess refreshing?

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));

View solution in original post

Re: How to add user to the document team with the accsess refreshing?

Thanks Matthew! Love your answers. They are contains directly what I need to reach the result.

Polls

Windchill Customers

What browser do you most commonly use? (Chrome, Firefox, Edge Chromium, Internet Explorer 11, Safari, Other)

Announcements
Learn more about how we are using our browser poll here