Skip to main content

Access model

Ember Nexus uses a graph based access model with optional attributes for more nuanced access. This means that individual users are not assigned a global role, but instead receive explicit ownership or access to specific elements.

These permissions are applied recursively, i.e. if you own some element, then you also own all the element’s children:

As ownership and access data are stored inside the same graph as relations, the access model is explicit, can be queried separately, and becomes a natural part of your data.

Access is split between individual access operations (read, create, update, delete and search) for quite granular permissions, as well as “ownership” (OWNS), which grants the owner full access.

The details are split into several pages:

How access is determined

For a user being able to interact with some element at all, an access path between the user and element must exist.
If no path can be found, or the element to be accessed is completely isolated, then the API responds to the user as if the element does not exist (404 error codes etc.):

Within a single specific path, the lowest overall access wins, e.g. in the following example HAS_READ_ACCESS is the lowest common access permission across the path, therefore the user only has read access:

When multiple parallel paths exist, the path with the highest access wins. In the following example, a full OWNS-path exists, therefore lower access operations are ignored:

Groups for delegating access

Instead of giving many users direct access to some element, a group can be used to delegate access.

This will look then like this:

To model more complex situations, a group can also be part of another group:

Important: For a user to be considered part of a group, there must exist a direct path of solely IS_IN_GROUP-relations between the user and the group. Using OWNS- and HAS_X_ACCESS-relations between the user and the group has other semantic meanings, and should be avoided unless explicitly required.

Writing to group nodes

Being a member of a group (via IS_IN_GROUP) grants READ, SEARCH and CREATE access to the group node itself, but not UPDATE, DELETE or GOVERN access. A group node can only be updated, deleted or shared by a user with an explicit OWNS or HAS_UPDATE_ACCESS/HAS_DELETE_ACCESS/HAS_GOVERN_ACCESS relation to that group node, not by virtue of membership alone. This does not mean that members can not use access which the group has been given: a relation from the group to another element counts for every member, whatever the access type.

In the following example, the member can hand out access to Data through the group, because the group has been granted HAS_GOVERN_ACCESS and HAS_READ_ACCESS to it. The member can not hand out access to the group itself:

Access operations

The following access operations exist:

  • OWNS: Full permissions.

  • HAS_READ_ACCESS: Only grants read permissions to the element. If you want to grant this access operation, you will likely want to grant HAS_SEARCH_ACCESS as well.

  • HAS_CREATE_ACCESS: Grants the permission to create new child nodes underneath the element.

  • HAS_UPDATE_ACCESS: Grants the permission to change the element.

  • HAS_DELETE_ACCESS: Grants the permission to delete the element and its children.

  • HAS_SEARCH_ACCESS: Grants the permission to search the element. Similar to HAS_READ_ACCESS, but explicitly relevant for search operations. Can not carry conditions, see conditional access.

  • HAS_GOVERN_ACCESS: Grants the permission to hand out and revoke access to the element, i.e. to create, change and delete OWNS, IS_IN_GROUP and HAS_X_ACCESS relations pointing to it, if the user holds the granted access themselves, see pointer relations and grant relations. OWNS implies it, group membership alone does not.

  • HAS_EXECUTE_ACCESS: Grants the permission to run an executable element, currently saved searches (type SavedSearch, see saved searches) through POST /search/<uuid>. It is independent of read access: neither implies the other, so a query can be hidden from the users who may run it, or be readable without being runnable. Like the other access relations it is inherited through OWNS chains and groups and can carry conditions; OWNS includes it, group membership alone does not. It has no effect on other elements, is only checked by execution endpoints and is not part of the search index.

Limitations and Exceptions

Regardless of access operations, overall permissions etc., there are a few element types and properties which can not be accessed, read or changed. These are usually only relevant for the API itself, or are dangerous to be changed by any user.

When user try to change these properties, relevant exceptions are being thrown and the current request is being canceled.

Other properties like createdAt and updatedAt are automatically set by the API, and can not be changed by the user as well.

Users always have full access to their own user element.

Performance considerations

Permission lists, i.e. which users and groups have access to each element, are calculated and cached in the background.

Adding new users to a group does only update a few cache entries internally, while giving a user direct access to a big tree of elements requires a somewhat expensive re-calculation of the whole tree. While this is done asynchronously in the background, it should be avoided.

Therefore, you should always use a group as a proxy object for bigger trees you might want to share with others in the future.

Metadata and timing attacks

Note that even with all security measures in place, some data can still be accessed by other users:

  • General graph structure, e.g. the types of nodes and relations present in the global graph, through the GET /graph-structure endpoint.
  • Timing data. Databases can and will act differently for elements which exist but need to be filtered out, as well as elements which are truly missing from the database. While these small differences are usually not enough to leak useful data, a persistent actor might be able to learn general patterns.