In Permify, attributes and relations between your entities, objects and users represents your authorization data. These data stored as tuples in a preferred database. Since these attributes and relations are live instances, meaning they can be affected by specific user actions within the application, they can be created/deleted with a simple Permify API call at runtime. More specifically, the application client should update preferred database about the changes happening in entities or resources that are related to the authorization structure. If we consider a document system; when some user joins a group that has edit access on some documents, the application side needs to write tuples to keep preferred database up-to-date. Besides, each attribute or relationship should be created according to its authorization model, Permify Schema. Another example: when one a company executive grant admin role to user (lets say with id = 3) on their organization, application side needs to tell that update to Permify in order to reform that as tuples and store in preferred database.Documentation Index
Fetch the complete documentation index at: https://proxy-docs.permify.co/llms.txt
Use this file to discover all available pages before exploring further.
/v1/tenants/{tenant_id}/data/write endpoint for both creating relation tuples and for creating attribute data.organization:1#admin@user:3 should be created as follows:
attributes argument to create attribute/attributes with a single API call, similarly creating a relational tuple.
Let’s say document:1 is a private (boolean) document, that only specific users have view access - document:1$is_private|boolean:true.
entity $ attribute | valuedocument:1#editor@user:1document:1$is_private|boolean:trueWriteData can be performed in any logical place in your stack.
Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant t1 for this field. Required, and must match the pattern \“[a-zA-Z0-9-,]+\“, max 64 bytes.
DataWriteRequest defines the structure of a request for writing data. It contains the necessary information such as tenant_id, metadata, tuples and attributes for the write operation.
DataWriteRequestMetadata defines the structure of metadata for a write request. It includes the schema version of the data to be written.
tuples contains the list of tuples (entity-relation-entity triples) that need to be written.
attributes contains the list of attributes (entity-attribute-value triples) that need to be written.
A successful response.
DataWriteResponse defines the structure of the response after writing data. It contains the snap_token generated after the write operation.
The snap token to avoid stale cache, see more details on Snap Tokens.