如何授予对SharePoint中SPListItem的访问权限
以下代码用于授予用户访问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);
但是,当当前用户域服务器与共享点服务器不同时,它将不起作用.
更多信息
我的Sharepoint服务器名称是spserver.域名服务器名称为domainserver.当我尝试将domainserver的用户权限授予共享点服务器SPListItem时,它无法分配,因为我可以将权限授予任何共享点组.使用上面的代码不会引发任何错误/异常,但用户无权访问该特定的SPListItem.
我想知道是否有人可以帮助我?
感谢
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
您可以通过以下步骤为Sharepoint中的SPListItem授予访问权限:
->转到网站操作
->网站设置
->在用户和权限"中,单击人员和组"
->点击新建
->添加您要授予权限的用户.
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.