Sofar logo
Sofar logo
Api
Delete a manages relation DELETECollect manages relations (replaced by POST /v1/role/{parentRoleId}/manages/query) GETCollect manages relations POSTCreate or update a manages relation PUTUpdate an existing manages relation PUT
Manages
PUT
/v1/role/{parentRoleId}/manages

Create a manages relation (or update the existing one) between two roles When a valid childRolePassword query parameter is specified, the call can be executed when the user is a member of an autorizing role which has direct or indirect roleManagement rights for the parent role of the newly created (or updated) manages relation. When no childRolePassword query parameter is provided, a user can only execute this action if he is a member of an autorizing role which has: direct or indirect roleManagement rights for the parent role of the newly created (or updated) manages relation indirect roleManagement rights for the child role of the newly created (or updated) manages relation

Authorization

accessBearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

parentRoleId*integer
Range0 <= value

Query Parameters

childRoleId*integer
Range0 <= value
childRolePassword?string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X PUT "https://api.eniris.be/v1/role/0/manages?childRoleId=0" \  -H "Content-Type: application/json" \  -d '{    "roleManagement": true,    "userManagement": true,    "viewManagement": true,    "deviceManagement": true,    "reportManagement": true,    "alarmManagement": true  }'

Collect manages relations POST

Get all (or some of) the manages relations which start from a role of which a user is a member (either directly or indirectly).

Update an existing manages relation PUT

Update an existing manages relation. A user can only execute this action if he is a member of an autorizing role which has (direct or indirect) roleManagement rights for the parent role of the manages relation

roleManagement*boolean
userManagement*boolean
viewManagement*boolean
deviceManagement*boolean
reportManagement*boolean
alarmManagement*boolean

Indicates that the parent role has the right to attach the child role and its decendants to any other role.

Indicates that the parent role has the right to manage member relations for the child role and its decendants.

Indicates that the parent role has the right to manage views relations for the child role and its decendants.

Indicates that the parent role has the right to manage monitors relations for the child role and its decendants.

Indicates that the parent role has the right to manage "views report relations" for the child role and its decendants

Indicates that the parent role has the right to manage "alarm relations" for the child role and its decendants

application/json

application/json

application/json

application/json

application/json

In the value field below, fill in the access token. It has a 10 minutes validity period. A valid token can be obtained via the /accesstoken endpoint (call), AFTER authorization with refreshBearerAuth and the refresh token.

Id of the parent role of the newly created (or updated) manages relation

Id of the parent role of the newly created (or updated) manages relation

Password for the child role of the newly created (or updated) manages relation

{
  "manages": {
    "id": 0,
    "parentRoleId": 0,
    "childRoleId": 0,
    "roleManagement": true,
    "userManagement": true,
    "viewManagement": true,
    "deviceManagement": true,
    "reportManagement": true,
    "alarmManagement": true
  }
}
{
  "statusCode": 400,
  "error": "Bad Request",
  "message": "Missing or misformatted query parameter or body"
}
{
  "statusCode": 401,
  "error": "Unauthorized",
  "message": "Failed to verify token"
}
{
  "statusCode": 403,
  "error": "Forbidden",
  "message": "User does not have sufficient rights"
}
{
  "statusCode": 409,
  "error": "Conflict",
  "message": "The proposed manages relation cannot be added since it would create a cycle in the role graph"
}
{
  "statusCode": 429,
  "error": "Too Many Requests",
  "message": "The provided childRolePassword query parameter cannot be checked, since too many successive failed role query calls occured"
}