> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superoffice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# roles

> RoleListProvider creates a MDO list of roles in the database. Default list are the employee roles. Use ExtraInfo to get other RoleTypes. ExtraInfo - "0" Default, to get employee roles ExtraInfo - "1" to get external users roles ExtraInfo - "2" to get anonymous roles. ExtraInfo - "3" to get system user roles.

## "roles" MDO List

RoleListProvider creates a MDO list of roles in the database.
Default list are the employee roles.
Use ExtraInfo to get other RoleTypes.
ExtraInfo : "0" Default, to get employee roles
ExtraInfo : "1" to get external users roles
ExtraInfo : "2" to get anonymous roles.
ExtraInfo : "3" to get system user roles.

Implemented by the <see cref="T:SuperOffice.CRM.Lists.RolesListProvider">RolesListProvider</see> class.
The name of the MDO list is 'roles'.

## Additional Attributes

| Description                                            | Name | Example Value |
| ------------------------------------------------------ | ---- | ------------- |
| Role type (0=employees, 1=ext users, 2=anon, 3=system) |      | 0             |

Separator: ;

## Sample Request

```http! theme={null}
GET /api/v1/MDOList/roles
Authorization: Basic dGplMDpUamUw
Accept: application/json; charset=utf-8
Accept-Language: *

```

## Sample Code

```cs theme={null}
var listProvider = ClassFactory.CreateRequired<SuperOffice.CRM.Lists.ISoListProviderFactory>().Create("roles", forceFlatList: true);
foreach (var item in listProvider.RootItems) {
    Console.WriteLine("{0} {1} {2} {3}", 
         item.Id, ResourceManager.ParseInlineResources(item.Name), item.StyleHint, item.ExtraInfo);
}
```

## Sample Output

| Id | Name                   | StyleHint | ExtraInfo |
| -- | ---------------------- | --------- | --------- |
| 1  | User level 0           |           |           |
| 2  | User level 1           |           |           |
| 3  | User level 2           |           |           |
| 4  | User level 3           |           |           |
| 5  | User level 4           |           |           |
| 6  | User level 5           |           |           |
| 7  | List Administrator     |           |           |
| 8  | User Administrator     |           |           |
| 9  | Local User             |           |           |
| 13 | eJournal Administrator |           |           |
| 14 | eJournal User          |           |           |
| 15 | CRM Administrator      |           |           |
| 16 | CRM User               |           |           |

## Related MDO Lists

* "rolesheadings"
* "rolesheadingswithallitem"
* "rolesheadingswithallitemwithnoselection"
* "rolesheadingswithnoselection"
* "roleswithallitem"
* "roleswithallitemwithnoselection"
* "roleswithnoselection"


## Related topics

- [Roles](/en/admin/user-management/role/index.md)
- [Role](/en/api/archive-providers/reference/role.md)
- [Update role](/en/admin/user-management/role/update-role.md)
- [Create a role](/en/admin/user-management/role/create-role.md)
- [Delete Role](/en/api/reference/restful/rest/role/delete-role.md)
- [Role table](/en/database/tables/role.md)
