SPWeb.BreakRoleInheritance 方法 (Boolean, Boolean)

Creates unique role assignments for the website, optionally copies role assignments from the parent website, and optionally clears unique role assignments from descendants.

命名空间:  Microsoft.SharePoint
程序集:  Microsoft.SharePoint(位于 Microsoft.SharePoint.dll 中)

语法

声明
Public Overrides Sub BreakRoleInheritance ( _
    copyRoleAssignments As Boolean, _
    clearSubscopes As Boolean _
)
用法
Dim instance As SPWeb
Dim copyRoleAssignments As Boolean
Dim clearSubscopes As Boolean

instance.BreakRoleInheritance(copyRoleAssignments, _
    clearSubscopes)
public override void BreakRoleInheritance(
    bool copyRoleAssignments,
    bool clearSubscopes
)

参数

  • copyRoleAssignments
    类型:System.Boolean

    true to specify role assignments are copied from the parent website to this website; false to specify only the current user is assigned to security roles.

  • clearSubscopes
    类型:System.Boolean

    true to specify unique role assignments are cleared from child objects and then inherit role assignments from this website; false to specify unique role assignments defined on child objects are left in place.

异常

异常 条件
SPException

You cannot change permissions on the root website of a site collection.

备注

This method breaks the inheritance of role assignments from the parent website, and creates unique role assignments for the current website.

另请参阅

引用

SPWeb 类

SPWeb 成员

BreakRoleInheritance 重载

Microsoft.SharePoint 命名空间

ParentWeb