Aniston NexusDocs
Open Aniston Nexus

Customer hierarchy

Arrange customers in up to five levels, such as University, School and Department, so that the users of a customer can see the customers below it.

Customers can sit below other customers, for example University > School of Life Sciences > Department of Biochemistry. A tree has at most five levels. Users of a customer can then view what belongs to the customers below their own, while every change stays with the customer that owns the entity.

Customers without a parent are top-level customers and behave exactly as before.

Arrange customers

Tenant administrators open Customers & users > Customer hierarchy. The page shows the customer tree with a search box and Expand all / Collapse all. For each customer:

  • Move under… opens a dialog to choose the new parent. The customer keeps everything below it. The dialog does not offer the customer's own descendants (that would make a loop) or customers whose level is too deep for the moved subtree.
  • Make top level removes the parent.
  • Open goes to the customer's details.

The parent can also be chosen in the customer's details: Customers & users > Customers, open the customer, edit, and pick the Parent customer (None (top level) removes it). The details show the path of the customer as Part of.

The public customer (used by public dashboards) cannot be part of the hierarchy.

What the users of a parent customer can do

Own customerCustomers below itParent, sibling and other customers
View devices, assets, entity views, dashboards and their attributes and telemetryYesYesNo
View alarmsYesYes (read only)No
View the customer recordsYesYesNo
Edit, delete, assign, send commands (RPC), read credentialsAs the customer permissions allowNoNo
Acknowledge or clear alarmsAs the customer permissions allowNoNo
Users and edgesOwn customer onlyNoNo

Lists, entity queries and dashboards of a customer user include the customers below theirs (up to 100 customers per query: the own customer and its first descendants). Public dashboard links never use the hierarchy.

Custom roles and customer permissions still apply on top: the hierarchy only widens what a customer user may view, never what they may change.

If the hierarchy cannot be read (for example during a database error), customer users see only their own customer, as without a hierarchy.

Rules the server checks

  • The parent must be another customer of the same tenant.
  • No loops: a customer cannot be moved under itself or under one of its descendants.
  • At most five levels, counted from the top-level customer.
  • Only tenant administrators change the hierarchy.

A link that breaks these rules (possible only when additionalInfo was written directly through the API) is ignored and the customer is treated as top level; the page marks it with "Stored parent is not valid and is ignored".

When a customer is deleted, the customers directly below it move up to its parent (or become top-level).

Where it is stored

The parent of a customer is stored in the customer's additionalInfo.nexusParentCustomerId (the id of the parent customer). No database table is added or changed, and exports, backups and version control carry it with the customer. Each server keeps the tree in memory; other servers of a cluster see a change within nexus.customer_hierarchy.cache_ttl_sec seconds (default 30).

REST API

CallWhat it does
GET /api/nexus/customers/hierarchyThe customer tree of the caller's tenant (a customer user gets their own customer and the ones below)
GET /api/nexus/customers/hierarchy/{customerId}One customer with its ancestors and children
GET /api/nexus/customers/hierarchy/{customerId}/descendantsAll customers below a customer
POST /api/nexus/customers/hierarchy/{customerId}/parentMove a customer: {"parentId": "<customer uuid>"}; null makes it top level
DELETE /api/nexus/customers/hierarchy/{customerId}/parentMake a customer top level

The two changing calls need a tenant administrator.