Adding permissions to a user account¶
Note
If the optional attributes are not set, the system adds a default value.
Note
The body does not contain the attributes id, created, and modified. The system sets the values of these attributes after the entry is created.
Sends a POST request to the endpoint /user/{id}/permissions.
Description¶
The Add-User-Permissions request allows the user to add one or more permissions to a user account of the organisation.
Requirements¶
Values of the request: User-ID {id}d}
Objects: ObjectPermissionVO
Request¶
To add user permissions to a user account, the User-ID {id} needs to be added to the path of the request.
For a detailed specification of which information is required to create permissions, one or more objects ObjectPermissionVO with the following attributes need to be defined in the body:
| Attributes | Description | Values |
|---|---|---|
objectType |
The type of the object. The object refers to the function in the Myra App. |
|
objectPermissionType |
The level of the permission. |
|
action |
The type of the permission. |
|
The following attributes are optional:
| Attributes | Description | Values |
|---|---|---|
objectInstance |
The ID of the main parent. | integer |
name |
The name of the object to which permissions have been assigned. Only filled if an assignment has been made. Otherwise, the attribute does not exist. | string |
scopes |
The list of children. | array |
parents |
The list of parents. | array |
value |
The value of the permission. | string |
The system responds by returning the object ObjectPermissionVO with the information about the new entry.
Example¶
Example request body:
{
"objectType": "Domain",
"objectPermissionType": "GROUP",
"action": "READ",
"objectInstance": 0,
"name": "string",
"scopes": [],
"parents": [],
"value": "string"
}
Responses¶
The following responses are available:
| STATUS CODE | DESCRIPTION |
|---|---|
| 201 | The request has succeeded and a new object has been created. |
| 400 | The request was unsuccessful. The request was invalid or information is missing. |
| 401 | The request has not succeeded because the user authentication was incorrect. |
| 403 | The request has not succeeded because the user does not have the right permissions. |