SPRoleDefinitionCollection.BreakInheritance method

Creates unique role definitions for the current Web site, optionally copies the role definitions from the parent Web site, and optionally maintains the role assignments.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)


Public Sub BreakInheritance ( _
    CopyRoleDefinitions As Boolean, _
    KeepRoleAssignments As Boolean _
Dim instance As SPRoleDefinitionCollection
Dim CopyRoleDefinitions As Boolean
Dim KeepRoleAssignments As Boolean

instance.BreakInheritance(CopyRoleDefinitions, _
public void BreakInheritance(
    bool CopyRoleDefinitions,
    bool KeepRoleAssignments


  • CopyRoleDefinitions
    Type: System.Boolean

    true to copy the role definitions of the parent Web site when breaking inheritance; false to use the default role definitions from the template.

  • KeepRoleAssignments
    Type: System.Boolean

    true to maintain role assignments; otherwise, false.


Exception Condition

The CopyRoleDefinitions parameter is false and the KeepRoleAssignments parameter is true.


Breaking role definition inheritance also breaks role assignment inheritance, which results in unique role assignments on the Web site. As a result, after this method is called the values of the HasUniqueRoleDefinitions property and the HasUniqueRoleAssignments property are both set to true.

If the Web site already has unique role definitions, this method returns without making any changes.

This method cannot copy role assignments without role definitions. Therefore, if the CopyRoleDefinitions parameter is false and the KeepRoleAssignments parameter is true, an exception is thrown.

See also


SPRoleDefinitionCollection class

SPRoleDefinitionCollection members

Microsoft.SharePoint namespace