Roles
Allows the creation, deletion and retrieval of SharePoint roles. Useful for customizing access control.
Table Specific Information
SELECT
Retrieves all roles created in the SharePoint Account:SELECT * FROM Roles
Retrieve all roles with the specified names in your SharePoint Account:
SELECT * FROM Roles WHERE [Name] = 'Role1'
SELECT * FROM Roles WHERE [Name] IN ('Role1', 'Role2')
Retrieve the roles assigned to a specific group.
SELECT * FROM Roles WHERE [GroupName] = "GroupName"
Retrieve the roles assigned to a specific user.
SELECT * FROM Roles WHERE [UserLoginName] = "LoginName"
INSERT
You can create roles by specifying writable (ReadOnly=false) columns in the INSERT statement as shown in the query example below. Note that some columns are always required, while other columns can be optionally specified.INSERT INTO Roles (Name, Description, Permissions) VALUES ('Testing Role 3', 'Role for testing.', '1073741826')
DELETE
You can delete a role by specifying the Name column in the criteria as shown in the query example below:DELETE FROM Roles WHERE Name = 'ReadOnly'
Columns
| Name | Type | ReadOnly | Description |
| Name [KEY] | String | False |
The name of the role. Helps identify the permission level assigned to users or groups. |
| Id | String | True |
The unique identifier of the role. |
| Description | String | False |
A brief description of the role. Useful for understanding its purpose and the permissions it grants. |
| Permissions | String | False |
The mask of permissions granted to the role. Helps define access control levels. To learn more about permission masks, check out the 'Permission Masks' section in Permissions. |
| RoleType | String | True |
Specifies the type of role. Useful for differentiating between built-in roles and custom roles. |
| IsHidden | Boolean | True |
Indicates whether the role is hidden from the user interface. Helps manage roles that are system-defined or restricted. |
| UserLoginName | String | True |
A filter for reading the roles assigned to a specific user. If this column is not specified in the criteria, it will have null values. |
| GroupName | String | True |
A filter for reading the roles assigned to a specific group. If this column is not specified in the criteria, it will have null values. |