如何获得 Sharepoint 2010 中的文档库权限?
我正在开发一个 Web 部件,我需要浏览每个文档库并获取其权限。基本上我需要获取与文档库关联的组及其权限。
我已经迭代了 SPDocumentLibrary
对象的属性和方法,但实际上找不到任何东西。
任何帮助或指导将不胜感激。
谢谢
I'm developing a Webpart and I need to go through every document library and get its permissions. Basically I need to get the groups and its permissions associated with the document library.
I have iterated through the properties and methods of a SPDocumentLibrary
object but couldn't find anything really.
Any help or guide would be appreciated.
Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我首先检查HasUniqueRoleAssignments。如果为 false,则该文档库的权限将从网站继承。如果这是真的,正如杰森所说,我会检查 成员和RoleDefinitionBindings每个 SPRoleAssignment。
I would first check HasUniqueRoleAssignments. If it is false, then the permissions for that document library are inherited from the website. If it is true, as Jason said, I would then check the Member and RoleDefinitionBindings of each SPRoleAssignment.
尝试 SPDocomentLibrary.RoleAssignments。
这将为您提供 SPRoleAssignments,其中 Member 属性是 SPGroup 或 SPUser。
Try SPDocomentLibrary.RoleAssignments.
This will give you SPRoleAssignments where the Member property is a SPGroup or a SPUser.