SPRoleAssignmentCollection.Remove method (Int32)

Removes the user or group at the specified index from the collection.

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

Syntax

'Declaration
Public Sub Remove ( _
    index As Integer _
)
'Usage
Dim instance As SPRoleAssignmentCollection
Dim index As Integer

instance.Remove(index)
public void Remove(
    int index
)

Parameters

  • index
    Type: System.Int32

    The index of the user or group to remove.

Exceptions

Exception Condition
InvalidOperationException

The HasUniqueRoleAssignments property of the ParentSecurableObject property is false.

Remarks

This method does not delete any data, but dissociates the user from the permissions of the object. To delete the data of the role definition and delete all role assignment bindings for a role definition, use one of the Delete methods of the SPRoleDefinitionCollection object.

See also

Reference

SPRoleAssignmentCollection class

SPRoleAssignmentCollection members

Remove overload

Microsoft.SharePoint namespace