RBAC vs ABAC vs ACL vs ReBAC: Choosing an Access Control Model
Access control models differ in one thing: what an authorization decision is based on.
RBAC vs ABAC in short: RBAC grants permissions to roles and assigns roles to users, so it answers "what can editors do?" easily but cannot say "only their own documents" without a role per document. ABAC evaluates conditions on attributes of the user, the resource and the environment, so it handles ownership, department and time rules naturally but is harder to audit. Most applications use RBAC for features and add ABAC conditions for records; the last example on this page does both in one Casbin model.
| Model | Decides on | Example rule |
|---|---|---|
| ACL (access control list) | The user | alice may edit design.md |
| RBAC (role-based) | The user's roles | editors may edit documents |
| ABAC (attribute-based) | Attributes of the user, the resource, and the context | owners may edit their documents; people in the same department may read them |
| ReBAC (relationship-based) | Relationships between the user and the resource | anyone who is a viewer of the folder may read the documents in it |
| PBAC (policy-based) | Rule expressions stored as policy | whatever condition the policy row contains |
These are not competing products: they are ways of writing rules, and real systems mix them. In Casbin each one is a few lines of model configuration, and you can switch or combine them without changing your application code. This page expresses the same small example in each model so that the differences are concrete.
The example: a document app with one document, design.md, owned by alice. alice should be able to edit it, bob should be able to read it, and nobody else should have access.