AddRoleAssignment
Assigns a new role to a specified user or group within a SharePoint list or list item. Important for fine-tuning permissions and access.
Input
| Name | Type | Required | Description |
| RoleId | Int | True | The unique ID of the role definition that specifies the permissions to be assigned. Determines the level of access granted. |
| PrincipalId | Int | True | The unique ID of the user or group receiving the assigned role. Helps identify who the permissions apply to. |
| List | String | True | The internal name of the SharePoint list where the role assignment will be applied. Useful for managing permissions at the list level. |
| ItemId | Int | False | The unique identifier of the list item to which the role assignment applies. Helps manage permissions at the item level. |
Result Set Columns
| Name | Type | Description |
| Success | Boolean | Indicates whether the role assignment operation was successful. Returns 'true' for success and 'false' for failure. |
| ErrorCode | Integer | If the procedure fails, this field displays the corresponding error code. Useful for debugging and troubleshooting. |
| ErrorMessage | String | If the procedure fails, this field provides a detailed error message explaining the failure. Helps diagnose permission assignment issues. |