Relationships
In Permify, relationship between your entities, objects, and users builds up a collection of access control lists (ACLs). These ACLs called relational tuples: the underlying data form that represents object-to-object and object-to-subject relations. Each relational tuple represents an action that a specific user or user set can do on a resource and takes form ofuser U has relation R to object O
, where user U could be a simple user or a user set such as team X members.
In Permify, the simplest form of relational tuple structured as: entity # relation @ user
. Here are some relational tuples with semantics,

Attributes
Besides creating and storing your authorization-related data as relationships, you can also create attributes along with your resources and users. For certain use cases, using relationships (ReBAC) or roles (RBAC) might not be the best fit. For example, geo-based permissions where access is granted only if associated with a geographical or regional attribute. Or consider time-based permissions, restricting certain actions to office hours. A simpler scenario involves defining certain individuals as banned, filtering them out from access despite meeting other requirements. Attribute-Based Access Control takes a more contextual approach, allowing you to define access rights based on the context around subjects and objects in an application. In Permify, the form of attributes are similar to relational tuples but with a small syntax differentiation:subject $ attribute | value
Here are some attributes with semantics,
account:1$balance|double:4000
- account:1’s balance is defined as 4000.post:546$is_restricted|boolean:true
- post:546 is labeled as restricted post within the system.user:122$regions|string[]:US,MEX
- user:122 is associated with regions United States and Mexico.
Where is the stored Authorization Data used?
These relational tuples and attributes represents your authorization data. Permify stores your these data in a database you prefer. You can configure the database when running Permify Service with using configuration options. Stored data are queried and utilized in Permify APIs, including the check API, which is an access control check request used to determine whether a user’s action is authorized. As an example; to decide whether a user could view a protected resource, Permify looks up the relations between that specific user and the protected resource. These relation types could be ownership, parent-child relation, a role such as an admin or manager or even an attribute.Creating Authorization Data
Relationships and attributes can be created with an simple API call, Since these attributes and relations are live instances, meaning they can be affected by specific user actions within the application, they should be created/deleted with a simple Permify API call at runtime. Each relational tuple or attribute should be created according to its authorization model, Permify Schema.
document:2#owner@user:1
Write Data API
You can create relational tuples by usingWrite Data API
.
Snap Tokens
In Write Data API response you’ll get a snap token of the operation.More Examples
Let’s create more example data according to the schema we defined above.Organization Admin
relational tuple: organization:1#admin@user:3 Semantics: User 3 is administrator in organization 1.Parent Organization
Relational Tuple: document:1#parent@organization:1#… Semantics: Organization 1 is parent of document 1.Note:
relation: “...”
used when subject type is different from user entity. #… represents a relation that does not affect the semantics of the tuple.Simply, the usage of … is straightforward: if you’re use user entity as an subject, you should not be using the ...
If you’re using another subject rather than user entity then you need to use the ...