SPRoleAssignmentCollection.RemoveById Method
Removes the user or group with the specified identifier (ID) from the role assignment collection.
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online
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.
| Exception | Condition |
|---|---|
| InvalidOperationException |
The HasUniqueRoleAssignments property of the ParentSecurableObject property is false. |