Unify and manage your data

Data Security

Reltio platform supports role-based data security.

Security rules can be applied for a subset of entities defined by a specific condition. Such conditions are represented by filters, similar to the filters in Entity Search.

Note: Data security is disabled for a newly created tenant. It is enabled when any permissions configuration, even an empty one, is applied to the tenant.

Get Entity Permissions

Requests which return entities support option showAccess. If this option is enabled, the entities are returned along with access level specifications for the entities and reference objects (both reference entities and reference relations).

Getting Entities with Access

Request

GET {TenantURL}/entities/00005KL?options=showAccess
Headers: Authorization: Bearer <Access-Token>, Content-Type: application/json

Response

{
    "uri": "entities/00005KL",
    "type": "configuration/entityTypes/HCP",
    ...
    "attributes": {
        "Employment": [
            {
                "label": "",
                "relationshipLabel": "Pediatrician",
                "value": {
                    "Title": [
                        {
                            "type": "configuration/relationTypes/Employment/attributes/Title",
                            "ov": true,
                            "value": "Pediatrician",
                            "uri": "entities/00005KL/attributes/Employment/00006OP/Title/1mtNpZ"
                        },
                     ...
                },
                ...
                "refEntity": {
                    ...
                    "type": "configuration/entityTypes/Organization",
                    "objectURI": "entities/00009ab",
                    "access": ["READ"]
                },
                "refRelation": {
                    ...
                    "objectURI": "relations/00006OP",
                    "access": []
                }
                ...
            }
        ],
    ...
    "label": "  ",
    "access": ["READ", "CREATE", "UPDATE"]
}

Configuration API

Data security is configured together with metadata security. Both are similar and use the same endpoints. A data security configuration record has an additional field filter. The specified privileges are applied for all entities that are accepted by a filter.

Note: Filter expressions follow the same format as the one used in Entity Search.

Data and Metadata Security Records

[
  {
    "uri": "configuration/entityTypes/HCP",
    "permissions": [
      {
        "role": "API_USER1",
        "access": ["READ"]
      },
      {
        "role": "API_USER2",
        "filter": "startsWith(attributes.FirstName, 'M')",
        "access": ["READ", "CREATE", "UPDATE"]
      }
    ]
  },
  {
    "uri": "configuration/entityTypes/Location",
    "permissions": [
      {
        "role": "API_USER1",
        "filter": "startsWith(attributes.City, 'New York')",
        "access": ["READ"]
      },
      {
        "role": "API_USER2",
        "access": ["READ", "CREATE", "UPDATE"]
      }
    ]
  },
  {
    "uri": "configuration/relationTypes/HasAddress",
    "permissions": [
      {
        "role": "API_USER1",
        "access": ["READ"]
      },
      {
        "role": "API_USER2",
        "access": ["READ", "CREATE", "UPDATE"]
      }
    ]
  }
]

Get Roles by Object URIs

This request is used to process specified URIs and return all available permissions for users, who are assigned the permission for an object. This is applicable for entities and Data Change Requests.

Note: For changeRequest, only roles for READ and ACCEPT_CHANGE_REQUEST access are returned.

Request

POST {env_uri}/reltio/permissions/{tenant}/_getAccessRoles

Contains a list of URIs to get information about allowed operations and accepted users.

Table 1. Parameters
ParameterNameRequiredDetails
HeadersAuthorizationYesInformation about authentication access token in format Bearer <accessToken> (see details in Authentication API).
Content-TypeYesMust be Content-Type: application/json.
QueryaccessTypesNoList of access types for which we want to obtain roles. Default: all access types.
BodyYesList of valid URIs. The operation can process only entities and data change requests. For example, entities/029OP2m or changeRequests/00010rp.

Response

For each URI from the input list, the response contains information about all privileges with all roles. The information is organized as a list of triplets with the following parts:

  • Object URI: can be a position in the configuration tree or the URI of a particular object in the system (entity, relation, attribute value).
  • Access: access type required for this object (directly requested or implied). Possible values: CREATE, READ, UPDATE, DELETE, MERGE, UNMERGE, INITIATE_CHANGE_REQUEST, ACCEPT_CHANGE_REQUEST.
  • Roles: set of roles that are configured to have such access type to this object in this tenant.

There is an additional field in each list record: allPermitted. When the accessRoles section is empty, the value of the allPermitted field must be analyzed: if it is true, then any role has all permissions, otherwise there are no roles which have any permission on that particular object.

Note: There are a few points to bear in mind when placing Data Change Request as a subject to get the required roles. Change requests cannot be specified as a configuration tree. ACCEPT_CHANGE_REQUEST are granted for entity types. Hence, the result set generated for each DCR contains all its change items represented by the URIs of the entity or the attribute specified in each change item. Every such item contains the changeRequestUri field to be able to associate objects from the request with objects from the response. ObjectUri may contain the URI of the DCR itself only if all the roles have full access to its content (for example, when security is off). Also, if access type ACCEPT_CHANGE_REQUEST is requested for a DCR, it is automatically converted to ACCEPT_CHANGE_REQUEST, READ, CREATE, UPDATE, DELETE, and MERGE.

Getting Roles for DCR

This example illustrates getting roles for a data change request from a tenant with no metadata security.

Request

POST {env_uri}/reltio/permissions/{tenant}/_getAccessRoles?accessTypes=ACCEPT_CHANGE_REQUEST
Headers: Authorization: Bearer <Access-Token>, Content-Type: application/json 
Body:
[
    "changeRequests/0bfdIEy"
]

Response

[
    {
        "objectUri": "changeRequests/0bfdIEy",
        "changeRequestUri": "changeRequests/0bfdIEy",
        "allPermitted": true
    }
]

Getting Roles for Entity

This example illustrates getting roles for an entity when there are roles only for specific permissions.

Request

POST {env_uri}/reltio/permissions/{tenant}/_getAccessRoles?accessTypes=READ,MERGE
Headers: Authorization: Bearer <Access-Token>, Content-Type: application/json 
Body:
[
    "entities/00005KL"
]

Response

[
  {
    "objectUri": "entities/00005KL",
    "allPermitted": false,
    "accessRoles": [
      {
        "access": "READ",
        "roles": [
          "API_USER2",
          "API_USER1"
        ]
      },
      {
        "access": "MERGE",
        "roles": [
          "API_USER2",
          "API_USER1"
        ]
      }
    ]
  }
]

Getting Roles for DCR with Change Items for Entity and Attributes

Let's assume that change request changeRequests/0Yd3jJw contains three change items: one of type CREATE_ENTITY and two of type INSERT_ATTRIBUTE. The first change item CREATE_ENTITY is about the first entity with ID entities/0Bymuem and the other two change items are about an already existing entity with ID entities/00006Mq. _getAccessRoles returns four sections (triplets): one for the CREATE_ENTITY change item and three for the rest two ones. Among those three sections we can find a section with required permissions for entities/00006Mq itself because attributes manipulations require some permissions on the root object besides attributes.
Note: With the applyDcrWithoutPermissions flag set to true in the configuration, you don't need UPDATE, CREATE, DELETE, or MERGE privileges on the objects to accept a change request, only the READ privilege. For more information, see topic DCR Security

Request

POST {env_uri}/reltio/permissions/{tenant}/_getAccessRoles?accessTypes=ACCEPT_CHANGE_REQUEST
Headers: Authorization: Bearer <Access-Token>, Content-Type: application/json 
Body:
[
    "changeRequests/0Yd3jJw"
]

Response

[
    {
        "objectUri": "entities/0Bymuem",
        "changeRequestUri": "changeRequests/0Yd3jJw",
        "allPermitted": false,
        "accessRoles": [
            {
                "access": "READ",
                "roles": [
                    "UI_USER",
                    "API_USER",
                    "ROLE_US"
                ]
            },
            {
                "access": "CREATE",
                "roles": [
                    "ROLE_US"
                ]
            },
            {
                "access": "ACCEPT_CHANGE_REQUEST",
                "roles": [
                    "ROLE_US"
                ]
            },
            {
                "access": "MERGE",
                "roles": [
                    "ROLE_US"
                ]
            }
        ]
    },
    {
        "objectUri": "entities/00006Mq",
        "changeRequestUri": "changeRequests/0Yd3jJw",
        "allPermitted": false,
        "accessRoles": [
            {
                "access": "READ",
                "roles": [
                    "UI_USER",
                    "API_USER",
                    "ROLE_US"
                ]
            },
            {
                "access": "ACCEPT_CHANGE_REQUEST",
                "roles": [
                    "ROLE_US"
                ]
            },
            {
                "access": "MERGE",
                "roles": [
                    "ROLE_US"
                ]
            },
            {
                "access": "UPDATE",
                "roles": [
                    "ROLE_US"
                ]
            }
        ]
    },
    {
        "objectUri": "entities/00006Mq/attributes/FirstName/1EqLIaWG",
        "changeRequestUri": "changeRequests/0Yd3jJw",
        "allPermitted": false,
        "accessRoles": [
            {
                "access": "READ",
                "roles": [
                    "UI_USER",
                    "API_USER"
                ]
            },
            {
                "access": "CREATE",
                "roles": [
                    "ROLE_US"
                ]
            },
	 {
                "access": "ACCEPT_CHANGE_REQUEST",
                "roles": [
                    "ROLE_US"
                ]
            }   
        ]
    },
    {
        "objectUri": "entities/00006Mq/attributes/FirstName/1EqLIemW",
        "changeRequestUri": "changeRequests/0Yd3jJw",
        "allPermitted": false,
        "accessRoles": [
            {
                "access": "READ",
                "roles": [
                    "UI_USER",
                    "API_USER"
                ]
            },
            {
                "access": "CREATE",
                "roles": [
                    "ROLE_US"
                ]
            },
	    {
                "access": "ACCEPT_CHANGE_REQUEST",
                "roles": [
                    "ROLE_US"
                ]
            }
        ]
    }
]