Sofar logo
Sofar logo
Api
Collect roles (replaced by POST /v1/role/query) GETCreate a new role and the manages relation which connects this role to its parent POSTCollect roles (alternative of GET /v1/role) POSTUpdate an existing role PUT
Role
POST
/v1/role

Authorization

Collect roles (replaced by POST /v1/role/query) GET

Get all (or some of) the roles of which a user is a member (either directly or indirectly). The POST /v1/role/query is a preferable alternative, which can better handle complex filters.

Collect roles (alternative of GET /v1/role) POST

Get all (or some of) the roles of which a user is a member (either directly or indirectly)

accessBearerAuth
AuthorizationBearer <token>

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.

In: header

Query Parameters

parentRoleId*integer
Range0 <= value

Request Body

application/json

The manages relation and role to be created.

TypeScript Definitions

Use the request body type in TypeScript.

manages*
role*

Response Body

application/json

application/json

application/json

application/json

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





















{
  "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"
}

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 child role.

:
true
},
"role": {
"id": 0,
"name": "string",
"selfRights": {
"roleManagement": true,
"userManagement": true,
"viewManagement": true,
"deviceManagement": true,
"reportManagement": true,
"alarmManagement": true
},
"userRights": {
"roleManagement": true,
"userManagement": true,
"viewManagement": true,
"deviceManagement": true,
"reportManagement": true,
"alarmManagement": true
}
}
}