Give Right to SPListItem
Following code is use to give permission to user to access SPListItem
//Add current user
tempRoleAssignment = new SPRoleAssignment((SPPrincipal)currentUser);
tempRoleAssignment.RoleDefinitionBindings.Add(web.RoleDefinitions.GetByType(SPRoleType.Contributor));
item.RoleAssignments.Add(tempRoleAssignment);
but it is not work when current user domain server is different than the sharepoint server.
More information My Sharepoint server name is spserver. Domain server name is domain开发者_如何学运维server. When I try to give right to user of domainserver to sharepoint server SPListItem it cannot assign as I can able give right to any sharepoint group. It does not fire any error/exception by using above code but user cannot have right to access that perticular SPListItem
I wonder if anyone can help me?
Thus, current user is on another domain than SharePoint server? How have you implemented this, one-way or two-way trusts?
Did you run an update on role assignment? (roleassignment.update() && pricipal.update()).
精彩评论