Share via


SPRoleAssignmentCollection.RemoveById Method

Removes the user or group with the specified identifier (ID) from the role assignment collection.

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

Syntax

'Declaration
Public Sub RemoveById ( _
    Id As Integer _
)
'Usage
Dim instance As SPRoleAssignmentCollection
Dim Id As Integer

instance.RemoveById(Id)
public void RemoveById(
    int Id
)

Parameters

  • Id
    Type: System.Int32

    The ID of the user or group to remove. The value of the ID does not correspond to the index of the role definition within the collection.

Exceptions

Exception Condition
InvalidOperationException

The HasUniqueRoleAssignments property of the ParentSecurableObject property is false.

Remarks

This method removes the user or group specified by the Id parameter from the role assignment collection.

See Also

Reference

SPRoleAssignmentCollection Class

SPRoleAssignmentCollection Members

Microsoft.SharePoint Namespace