Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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 domainserver. 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?

Thanks
Posted

1 solution

You can give access rights to SPListItem in Sharepoint by following steps:

--> Go to Site Actions
--> Site Settings
--> In "Users and Permissions", click on "People and Groups"
--> Click on New
--> Add users that you wanna give rights on.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900