Security


The Xelion security model is used to edit the access of specific entity objects.
In most entity’s the security settings are handled automaticly by the server.
In this case the security information cannot be read or edited.
There are some entity’s where the security can be edited or read, for example 'Triggers'
This document tells how to read en write the security information.

Domains are normally users, so when you want to add a domain select a user from the the user list.
UserProfile is a sub of Domain.

Entity’s where the security can be read or edited

XCCTrigger

A Trigger, used to only activate this trigger for specific users.

Phone Line → Wallboard Security Object

The phone line wallboard sub object security attributes can be changed for securing the wallboard access.

Addressable

The Addressable object security attributes can be changed for securing acces to addressable data.

List

The List object security attributes can be changed for securing acces to lists.

Resource

/<ENTITY>/<OID>
/<ENTITY>/<SUBOBJECT ENTITY>

Parameters

None

Payload

None

Response

Object Response < Entity > Fields accessRights and domain

Context

Authorization

User or Admin, depends on Entity type

Errors

Examples

<ENTITY> is the Entity resource of the API, for example Trigger.
All the calls below are extensions on the GET, CREATE and PATCH calls of the implemented Entity.

Create an Entity

Request
POST https://xelion.nl/api/v1/master/<ENTITY>
Payload
{
    "commonName": "name of the entity",
    "objectType": "Entity",
    "accessRights": "Secured",
    "domain": [
      {
        "domain":
        {
                "oid": "1651120",
                "objectType": "Domain"
        },
        "objectType": "SecurityAttributes",
        "writeObject": true
      }
    ]
}
Response
{
  "object": {
    "commonName": "name of the entity",
    "oid": "453456",
    "objectType": "Entity",
    "accessRights": "Secured",
    "domain": [
      {
        "domain":
              {
            "oid": "1651120",
            "objectType": "Domain"
          },
        "objectType": "SecurityAttributes",
        "writeObject": true
      }
    ]
  },
  "links": [
    {
      "rel": "self",
      "href": "https://xelion.nl/api/v1/master/<ENTITY>/1801487",
      "method": "GET"
    }
  ]
}

Read an Entity

Request
GET https://xelion.nl/api/v1/master/<ENTITY>/12345
Response
{
  "object": {
    "oid": "1802543",
    "commonName": "name of the entity",
    "objectType": "Entity",
    "permissions": "ReadWriteRemove",
    "accessRights": "Secured",
    "domain": [
      {
        "domain":
              {
            "permissions": "ReadWriteRemove",
            "commonName": "arno",
            "oid": "1651120",
            "objectType": "UserProfile"
          },
        "oid": "1802545",
        "objectType": "SecurityAttributes",
        "writeObject": true
      }
    ]
  },
  "links": [
    {
      "rel": "self",
      "href": "http://localhost:8080/api/v1/master/triggers/1802543",
      "method": "GET"
    }
  ]
}

Update / Patch an Entity

Request
PATCH https://xelion.nl/api/v1/master/<ENTITY>/12345

add a new domain to the entity, first add a path with a virtual id '1' and insert the oid of the user profile as value

{
    "operations": [
            {
        "op": "add",
            "path": "/domain/1",
            "value": "1756113"
            }
    ]
}

remove a domain from the entity, <OID> is the oid of the enity → domain relation object SecurityAttributes

{
     "operations": [
            {
            "op": "remove",
            "path": "/domain/321443"
            }
    ]
}

edit security attributes of a entity domain relation, <OID> is the oid of the enity → domain relation object SecurityAttributes

{
     "operations": [
            {
            "op": "replace",
            "path": "/domain/321443/writeObject",
        "value": true
            }
    ]
}