Liking cljdoc? Tell your friends :D

Access control

Every request to Synthigy runs as a principal — a user, or the service identity of an application — and every read and write is checked against that principal's roles. There are three layers, each answering a different question:

LayerQuestionWhen it says no
Entity and relation rulesMay this principal touch this kind of record at all?the request fails with ENTITY_FORBIDDEN / FORBIDDEN
Attribute rulesMay it read or write this field?the field is left out of reads; writes to it are refused
Row rulesWhich records?the records are simply not there

Users, groups and roles

  • A user signs in with a password, an external identity provider or a connector (IAM_CONNECTORS.md).
  • A service user is created for every confidential OAuth client; tokens the client gets with its own credentials run as it (OAUTH.md).
  • A group collects users. Roles are given to users directly or to a group, and every member then holds them.
  • The SUPERUSER role passes every check. The portal creates the first superuser; keep the list short.

Users, groups and roles are records like any other: manage them in the engine console (Administration → Users, Groups, Roles) or over /data.

Entity and relation rules

Access control is switched on per entity, in the data modeling tool.

An entity with access control switched off is open to every signed-in caller, for every operation. Switch it on for anything that is not meant to be shared with all of them.

Once it is on, a role may do on that entity only what it is granted:

GrantAllows
createinsert records
readread records
updatechange records
deletedelete records
browseread — for directory-style visibility without other rights
ownerseverything above

Relations have their own grants — read, write (link and unlink) and delete. Owning both entities of a relation implies its grants.

Grants are attached to roles, not stored in the model version, so they can be changed on a deployed model without deploying anything.

Attribute rules

On an entity with access control on, an attribute can deny a role read or write. A denied attribute is silently left out of that role's reads — a query that selects it still succeeds — and a write that sets it is refused with ATTRIBUTE_FORBIDDEN.

Passwords are an example: User.password is readable and writable by superusers only. Users change their own password in the console, under Profile.

Row rules

Row rules decide which records of an entity a principal sees, changes and deletes. They are written in the data modeling tool, per entity:

  • A rule is a guard for one or more operations: read, write (create and update) or delete.
  • A guard has conditions. Each condition ties the record to the principal:
    • an attribute of type user, group or role on the record matches the principal, one of its groups, or one of its roles — owner is me, team is one of my groups;
    • or a path of relations from the record ends at the principal, its groups or its roles — the project's members include me.
  • All conditions of a guard must hold. A record is allowed when any guard for that operation holds.
  • Row rules on with no guard for an operation means no record for that operation.

Records outside the rules are filtered out, never reported as errors: a search returns fewer rows, and an update of a hidden record does not happen (DELETE_FORBIDDEN for an explicit delete). Every user can always read their own User record.

A deploy is refused when a guard would stop working — for example because a new version removes an attribute the guard depends on. Without that check the guard would quietly deny the operation for everyone.

Scopes

Some operations are not about records and are granted as scopes on a role:

ScopeAllows
dataset:loadread the model and its versions
dataset:deploydeploy model versions
dataset:deletedestroy a dataset
dataset:subscriptionbe notified when a model is deployed
schema:readread the model as a schema, for code generation and editor tooling
log:readquery logs and traffic
log:configurechange log levels and destinations at runtime

Built-in roles

Synthigy ships these roles; use them as they are or as a starting point.

RoleFor
IAM AdminFull administrator of users, groups, roles, OAuth, federation and service identities
IAM AuditorRead-only view of the whole IAM and OAuth configuration
User AdminDay-to-day users, groups and memberships; cannot assign roles
Role AdminCreating roles and assigning them
Access AdminThe grants matrix: which roles may do what on which entities
Department AdministratorAdministration delegated to the groups it manages
User ProvisionerCreating accounts and their onboarding links, delegated to its groups
Internal MemberBaseline for staff: browse users, groups and public profiles
Dataset DeveloperDesigning, deploying and administering every dataset
Dataset ModelerModeling the datasets shared with it
Dataset ExplorerReading the whole dataset catalog
XSQL DeveloperThe schema for code generation and editor tooling; no data access

Delegated administration

To let a team or an application manage only its own users, give users an owner group and give the administrators a role scoped to it (User Provisioner, Department Administrator). Row rules on User keep each administrator to the users of the groups it belongs to.

New accounts are created over /data. The person then sets their own first credential: a confidential client calls POST /oauth/onboard with the user's xid and gets a one-time link (24 hours by default) to deliver by mail or any other way. The link lets the person choose a password or link an identity provider. Synthigy never sends mail itself.

Can you improve this documentation?Edit on GitHub

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close