SPListItem.BreakRoleInheritance Method (Boolean, Boolean)

Creates unique role assignments for the list item, optionally copies role 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
<ClientCallableAttribute> _
<ClientCallableExceptionConstraintAttribute(FixedId := "2", Condition := "Lack of permissions to perform the operation.",  _
    ErrorType := GetType(UnauthorizedAccessException))> _
Public Overrides Sub BreakRoleInheritance ( _
    copyRoleAssignments As Boolean, _
    clearSubscopes As Boolean _
)
'Usage
Dim instance As SPListItem
Dim copyRoleAssignments As Boolean
Dim clearSubscopes As Boolean

instance.BreakRoleInheritance(copyRoleAssignments, _
    clearSubscopes)
[ClientCallableAttribute]
[ClientCallableExceptionConstraintAttribute(FixedId = "2", Condition = "Lack of permissions to perform the operation.", 
    ErrorType = typeof(UnauthorizedAccessException))]
public override void BreakRoleInheritance(
    bool copyRoleAssignments,
    bool clearSubscopes
)

Parameters

  • copyRoleAssignments
    Type: System.Boolean

    If true, this method copies the role assignments of the parent securable object when breaking inheritance; otherwise, this method adds the current user to the permission level that is required to manage the list item.

  • clearSubscopes
    Type: System.Boolean

    Indicates whether subscopes should be cleared or not.

Remarks

This method breaks the role assignment inheritance for the list item, and creates unique role assignments for the list item with the copyRoleAssignments parameter which specifies whether to copy role assignments from the parent object and with the clearSubscopes parameter which specifies whether to clear role assignments from child objects.

This method calls the BreakRoleInheritance(Boolean, Boolean) method to create the new role assignments for the list item.

See Also

Reference

SPListItem Class

SPListItem Members

BreakRoleInheritance Overload

Microsoft.SharePoint Namespace