Role-Based Access Control (RBAC) is the right choice when access decisions depend on who a user is within an organization — admin, manager, member — rather than on specific resource relationships or request context. If your permission logic maps cleanly to a fixed set of named roles, RBAC is the simplest and most maintainable approach. In Permify, roles are modeled as relations on an entity. You assign users to those relations, then write actions (permissions) that reference them. No special role construct is required — the schema DSL handles it naturally.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Permify/permify/llms.txt
Use this file to discover all available pages before exploring further.
When to use RBAC
- You have a predictable, bounded set of roles (e.g.,
admin,manager,member). - Permissions are uniform across all users with the same role.
- You don’t need per-resource ownership rules or dynamic attribute checks.
- You want a model that is easy for non-engineers to reason about.
Example: SaaS organization with file permissions
This example models an organization with four roles —admin, manager, member, and agent — and two categories of resources: organization files and vendor files. Each resource category has its own set of permissions, and some roles have narrower access than others.
Complete schema
How the schema works
Theorganization entity declares four relations. Each relation maps directly to a role — any user can be assigned to one or more of them.
Actions combine roles with boolean operators (or, not) to express nuanced rules:
action edit_files = admin or manager— only admins and managers can edit files.action view_files = admin or manager or (member not agent)— admins, managers, and members who are not also agents can view files. Members who hold theagentrole are excluded.action delete_vendor_file = agent— only users with theagentrole can delete vendor files.
and, or, not, and and not operators so you can express any combination of roles in a single action.
End-to-end implementation
Write the schema
Push your schema to Permify using the Schema Write API.Save the returned
schema_version — you can pin requests to a specific version to avoid race conditions during schema updates.Assign users to roles
Write relationship tuples to assign users to roles within an organization. Each tuple takes the form
entity#relation@subject.Permission matrix
The following table summarizes which roles can perform each action in this schema.| Action | admin | manager | member | agent |
|---|---|---|---|---|
view_files | ✅ | ✅ | ✅ | ❌ |
edit_files | ✅ | ✅ | ❌ | ❌ |
delete_file | ✅ | ❌ | ❌ | ❌ |
view_vendor_files | ✅ | ✅ | ❌ | ✅ |
edit_vendor_files | ✅ | ❌ | ❌ | ✅ |
delete_vendor_file | ❌ | ❌ | ❌ | ✅ |
A
member who is also assigned the agent relation is denied view_files because of the member not agent expression. Both relations must be checked when evaluating that action.Related resources
Building ReBAC Systems
Add relationship-based rules on top of roles — useful for resource ownership and hierarchies.
Building ABAC Systems
Extend permissions with attribute checks such as IP range, region, or account balance.
Modeling guide
Full reference for the Permify Schema DSL — entities, relations, actions, and rules.
Sync data
Learn how relationship tuples are written and stored.