Skip to main content
Attribute-Based Access Control (ABAC) grants or denies permissions based on properties of the resource, the requester, or the environment — not just their relationships. Permify supports ABAC through two schema primitives: attribute and rule.

How Attributes and Rules Work

An attribute is a typed property attached to an entity:
Supported attribute types: A rule is a named function that evaluates an expression over one or more attribute parameters and returns true or false. Rules are written in Common Expression Language (CEL).
Rules can also read from context.data — dynamic values passed at check time rather than stored as entity attributes.
Permify’s rule syntax is based on Common Expression Language (CEL). The syntax is nearly identical to C++, Go, Java, and TypeScript expressions.

Patterns

Public and Private Resources

The simplest ABAC pattern uses a single boolean attribute to toggle a resource between public (visible to anyone) and private (visible only to the owner).

How it works

  • view — granted if is_public is true or the subject is the owner.
  • edit — granted only to the owner, regardless of visibility.
When is_public is false (or not set), only the owner can view the resource.

Writing the attribute

Set the attribute value when creating or updating a resource using the data write API:
This pattern works well for social platforms where posts can be restricted to followers only based on a boolean is_public attribute.