我想创建一个具有自己的自定义权限级别的子网站。目前,当我访问权限级别屏幕 http://servername/subsite1/_layouts/role.aspx 时我看到了所有权限级别,但这些是来自 rootweb 的权限级别。如何打破这里的继承并添加我自己的自定义权限级别?
目的是因为该角色在该站点之外没有用处,因此我不想将其放在根目录中。
这个问题与这里提出的问题相同:http://social.technet.microsoft.com/Forums/en-US/sharepoint2010setup/thread/32ad2700-8009-4636-880e-07acfca98a06但 Shah Mehul 回复说可以通过编程来完成。难道他弄错了?我已阅读 SPWeb.BreakRoleInheritance(Boolean, Boolean) 处的参数说明但它们没有描述权限级别。
最佳答案
您仍然可以在 sharepoint 2010 中中断权限级别继承,尽管只能通过编程方式进行(引用:http://technet.microsoft.com/en-us/library/ff607713.aspx,子网站的权限部分)
要以编程方式中断它,您可以使用 SPRoleDefinitionCollection.BreakInheritance 方法 ( http://msdn.microsoft.com/en-us/library/ee547386.aspx )
Powershell 示例:
$web = Get-SPWeb "your site URL"
$web.RoleDefinitions.Delete("Some Custom Perm Level") # will not work, because perm levels are inherited
$web.RoleDefinitions.BreakInheritance(true,true)
$web.RoleDefinitions.Delete("Some Custom Perm Level") #will work
关于sharepoint - 以编程方式打破权限级别继承,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7038444/