Skip to main content

Overview

A Team (Resource Group) can carry attributes: named lists of values such as the brand or the market it manages. Roles then point to an attribute instead of hard-coding the value, so a single “Brand marketer” role filters every user to the brands of their own Teams.
The response carries the updated Team:
Writing attributes needs the existing Teams permissions: create for POST, update for PATCH. See Authentication to get an access token.

Writing attributes

attributes is accepted by POST /v2/entities/resource-groups and PATCH /v2/entities/resource-groups/{id}.
SCIM provisioning never writes or clears attributes. A Team synced from your identity provider keeps the attributes you set through the API.

Validation

The total size keeps the identity forwarded between Reelevant services within HTTP header limits. An invalid map returns 400 with error_code 5106 and the list of issues:

Inheritance

A Team inherits the attributes of its parent Teams. The effective attributes of a Team are resolved as follows:
  • The Team’s own keys come first, then those of its parents, then grandparents, following parentIds.
  • The closest Team wins for each key. A key’s list is replaced, never merged with an ancestor’s list.
  • When two parents at the same distance set the same key, the first one in parentIds order wins.
  • The climb stops at a Team with excludeFromAncestorInheritance: true: its own attributes apply, its ancestors’ do not. This is the same rule as for Team scopes.

Value for a user

A user in several Teams gets, for each key, the union of the effective values of all their Teams. A user in Aurora France and Solstice has brand: [Aurora, Solstice], locale: [fr_FR] and channel: [email]. The values are resolved when the access token is checked, so an attribute change applies to the user’s next request.

Using attributes in role conditions

A role rule references an attribute with { "$resourceGroupAttribute": "<key>" }. The reference is resolved to the requesting user’s values. Create or update the role with POST /v2/entities/roles or PATCH /v2/entities/roles/{id}.

Datasource row filter (datasource_query)

On a query Datasource rule, the query filter of a datasource_query condition can use a reference instead of a static value: A user without the attribute gets $in: [], so no row matches. $in is only accepted here with a $resourceGroupAttribute reference, and only in role conditions. For a static list of values, use $eq with a string[] (see Operators).

Object option constraint (datagraph_option)

On a read DatagraphEntity rule, a datagraph_option condition limits which values the user may pass to an Object option when querying it.
Object queries do not enforce datagraph_option yet: enforcement ships in an upcoming Datasources release. Roles can already store the condition, and AuthenticatedUser.getDatagraphOptionConstraints(entityId) from @reelevant-tech/permissions 6.7.0 returns the resolved constraints.
The user’s query must set the option to one of their values. A user without the attribute has no allowed value. When several conditions apply to the same Object, all of them must be met.
Role conditions apply to requests made by users. Workflow executions by the Runner are not filtered by them.

Validation errors

Both return 400. The index in rules.0 points to the rejected rule.