如何授予对SharePoint中SPListItem的访问权限 [英] How to give access rights to SPListItem in Sharepoint

查看:113
本文介绍了如何授予对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.


这篇关于如何授予对SharePoint中SPListItem的访问权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆