User role (role)
Description
A role available for assignment in user role lists.
Allows binding permissions to access REST and WebSocket API (routes) and role web applications (webapps).
A user assigned the role gets access to the specified APIs and web applications.
In particular, user roles can be used to build role models based on dynamic classes and their corresponding role applications.
Supports inheritance.
The full set of roles with lists of groups and users to whom they are assigned is available via API roles_caches.
Fields
{
"id": uuid,
"name": str,
"description": str,
"parent_id": uuid,
"routes": array<object>,
"opts": {
"title": str,
"comment": str
},
"security": object,
"ext": {
"ct": date,
"lwt": date
}
}
| Specification | Description |
|---|---|
Field: |
Identifier. Can be specified at creation, otherwise generated by the system. |
Role name (lowercase Latin). There are predefined roles for which allowed routes are already set in the build metadata. When a role with the same name is created, the permissions are merged. The list of predefined roles may vary; the main ones are listed below:
For a user to be able to modify data in static collections of the domain center, the role 'admin', 'crud', or 'crud.*' (where * is an arbitrary string) must be assigned directly in the user’s account. In any other case the domain center will not allow the request, even if the routes allow it. Several approaches can be used to configure project-specific roles that have modification access to some static collections of the domain center (beyond those allowed by the 'user' role):
|
|
Field: |
Role description |
Field: |
Identifier of the base group whose settings are fully copied. |
Field: |
List of allowed API endpoints. Each list element is an object: {
"url": ...,
"method": [...]
}
The URL must specify a concrete endpoint. Supported:
Within each collection, the following endpoints are distinguished:
Or "/rest/v1/model/my/test/**" - all collection endpoints except the collection endpoint itself. Methods: "GET", "POST", "PUT", "PATCH", "DELETE", "LOOKUP", "HEAD", "CLEAR", "*", "WEBSOCKET". There are other non-standard methods for specific endpoints. For example, the "INVITEBYIVR" method is used to create a call on behalf of IVR. They are listed in the API description of specific endpoints. Such methods are included in "*" or must be specified separately. The "WEBSOCKET" method is used to grant access to various WebSocket APIs. The specific API module is specified after the hash in "url" (see the example below). Example: [
{
"url": "/rest/v1/model/my/test",
"methods": ["GET","CLEAR"]
},
{
"url": "/rest/v1/model/my/test/*",
"methods": ["GET","PUT","PATCH","DELETE"]
},
{
"url": "/rest/v1/model/my/test/**",
"methods": ["*"]
},
{
"url": "/ws#subscr",
"methods": ["WEBSOCKET"]
}
]
|
Field: |
Returns the list of web applications available to the role. |
Field: |
|
Field: |
Arbitrary title |
Field: |
Arbitrary comment |
Field: |
Allows extending the compound with arbitrary keys and values. |
Field: |
Allows extending the compound with arbitrary keys and values. |
Field: |
Object creation time |
Field: |
Time of last modification of the object |