Compartilhar via


SPList.BreakRoleInheritance Method (Boolean, Boolean)

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

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online

Syntax

'Declaration
<ClientCallableExceptionConstraintAttribute(FixedId := "a", Condition := "User does not have permissions to break role inheritance.",  _
    ErrorType := GetType(UnauthorizedAccessException))> _
<ClientCallableAttribute> _
Public Overrides Sub BreakRoleInheritance ( _
    copyRoleAssignments As Boolean, _
    clearSubscopes As Boolean _
)
'Usage
Dim instance As SPList
Dim copyRoleAssignments As Boolean
Dim clearSubscopes As Boolean

instance.BreakRoleInheritance(copyRoleAssignments, _
    clearSubscopes)
[ClientCallableExceptionConstraintAttribute(FixedId = "a", Condition = "User does not have permissions to break role inheritance.", 
    ErrorType = typeof(UnauthorizedAccessException))]
[ClientCallableAttribute]
public override void BreakRoleInheritance(
    bool copyRoleAssignments,
    bool clearSubscopes
)

Parameters

  • copyRoleAssignments
    Type: System.Boolean

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

  • clearSubscopes
    Type: System.Boolean

    true if unique permissions are cleared from child objects and they can inherit role assignments from this object; false if unique role assignments defined on child objects are left in place.

See Also

Reference

SPList Class

SPList Members

BreakRoleInheritance Overload

Microsoft.SharePoint Namespace