A team picks an authorization model once and then lives with it for years. The choice usually gets made in an afternoon, by whoever was closest to the code, under a deadline. The exceptions start arriving about a month later.
If you are weighing RBAC vs ABAC vs ReBAC, you are at that afternoon now.
Role-based access control (RBAC) decides by the roles a user holds. Attribute-based access control (ABAC) decides by properties of the user, the resource and the moment. Relationship-based access control (ReBAC) decides by how the user is connected to the one specific resource in the request. Production systems rarely pick one of the three. A single request usually asks a question that each one answers best, so they use all three, each for the rules it states cleanly.
To show why, take one requirement and try to satisfy it three times. A bank has forty account managers and two thousand customers. The requirement is one sentence: an account manager may open a customer's statement. Every model below gets the same sentence to implement.
RBAC grants permissions to roles and roles to people. Nobody holds a permission directly. The role is the unit of administration, which is what makes RBAC easy to reason about and easy to review: you can print the list.
The first implementation takes ten minutes. Create an account-manager role, grant it statement:read, assign it to all forty managers.
Then someone notices that all forty can open all two thousand statements.
The standard fix is more roles. One per branch, so a manager cannot read another branch's customers. Then private banking needs separating. Then one product line turns out to have its own confidentiality rule. Role names stop describing job functions and start encoding the cross product of every dimension that matters. We covered the mechanics in why RBAC breaks down at scale: role counts grow multiplicatively rather than additively once tenants, regions and delegation arrive.
What RBAC got right is worth keeping. It answered "may this person read statements at all" correctly, cheaply, and in a form an auditor can read. That question still needs answering whatever you add next. The mistake is asking RBAC the second question, the one about which statement.
ABAC decides from properties: attributes of the user, attributes of the resource, and attributes of the request itself. Instead of enumerating who may act, you state the condition under which acting is allowed, and the condition is evaluated fresh each time.
The same requirement becomes one rule that covers all forty managers with no new roles:
allow statement:read when
user.branch == customer.branch
and request.time in businessHours
and customer.segment in user.clearedSegments
This is a real gain. The branch dimension that was about to become forty roles is now one comparison, and adding a new branch requires no authorization change at all.
Then the requirement gets more specific, as requirements do. The actual bank rule is not that a manager may read customers in their branch. It is that a manager may read the customers assigned to them. Assignment is not a property of the manager or of the customer. It is a fact about the pair.
You can flatten it into an attribute. Put assignedManagerId on the customer and compare it to the user. That works, for exactly one hop. Then coverage arrives: when the assigned manager is on leave, their team lead may open the statement. Now the decision needs the manager's team, its lead, and the leave calendar, each another attribute to source and keep fresh. The policy turns into a chain of equality checks that no longer reads back as the sentence the business actually said.
That is ABAC's real cost. As our walkthrough of Keycloak Authorization Services puts it, in most real ABAC systems the attribute pipeline, not the policy language, is where the effort and the bugs concentrate. Writing the condition is the easy half. Guaranteeing that customer.segment is correct at the moment of the request is the other one.
ReBAC decides from the connections between the user and the resource. The model is a graph, the rule is a path through it, and the question is whether such a path exists.
The same requirement, stated as a relationship, is the sentence the business said:
A user may read a statement if they are assigned to the customer who owns the account the statement belongs to, or if they lead the team of someone who is.
The chain is manager → assigned-to → customer → owns → account → has → statement, and the team-lead hop is one more edge rather than the team and team-lead attributes ABAC had to source. The leave check does not go away: it stays an attribute condition riding on top, which is exactly the combination the next section is about. Because the rule follows the same path the business describes, it survives being read aloud in a review, which is the property ABAC lost.
ReBAC earns its place wherever the right to act is a fact about a pair: ownership, document and folder sharing, project membership, nested groups, and corporate structures where a parent may see its subsidiaries. Those rules become unmaintainable as roles and unreadable as attribute chains.
Its boundary is a clean one. Some rules have nothing to do with who knows whom. A statement older than ten years is archived and must not open from this screen. A request from an unrecognized device should read but not export. No relationship expresses either. Some relationship engines let a tuple carry a condition, but that condition is an attribute check, not a relationship. You can force them into the graph by inventing edges for time or device state, but that encodes circumstances as connections, the same category error as encoding branches as roles.
The columns that matter are what the model decides by, where it is weak, and what a rule looks like when it belongs there.
| Model | Decides by | Best for | Weak at | Example rule |
|---|---|---|---|---|
| RBAC | The roles a user holds | Stable job functions, coarse capability gates, access reviews | Exceptions, per object rules, role counts that multiply | Support agents may read tickets |
| ABAC | Attributes of the user, the resource and the moment | Circumstances: time, location, data class, record age, device | Readability as rules compose, and sourcing trustworthy attributes | Records may be opened only during business hours |
| ReBAC | How the user is connected to the resource | Ownership, sharing, teams, nested hierarchies, delegation | Rules that no connection expresses, such as record age | A project team member may edit that project's documents |
Go back to the requirement and notice that it was never one question. A single request to open a statement asks three:
A role says what kind of thing you may do. An attribute says under what circumstances. A relationship says which particular object. One request needs all three answers, so a system that can only express one of them will push the other two somewhere worse, usually into application code where nobody can review them.
The term policy-based access control (PBAC) belongs here, and the field uses it in two ways. Broadly it covers any authorization driven by externalized policy rather than code. Narrowly, the sense that matters here, it names a policy that combines conditions from the other models and declares how their verdicts resolve: all must pass, any one is enough, or the majority decides. That choice is explicit, because "manager and business hours" and "manager or business hours" are one flag apart.
So the model question is the wrong unit. You do not pick a model for the company. You pick one per rule, and you need an engine that can hold all of them at once.
Keycloak gives you RBAC properly. Realm roles, client roles, composite roles and groups are a complete role model, and for a large share of services that is genuinely all that is required.
Beyond that, Keycloak Authorization Services adds resources, scopes, policies and permissions, with a decision strategy that controls how multiple policies on the same resource combine. It ships role, user, client, client-scope, group, time, regex, aggregate and js policy types. So role rules and time rules are built in, and aggregate lets you compose them.
The picture for the other two models is more qualified.
scripts feature flag. Our deep dive on Authorization Services covers the configuration and the attribute pipeline behind it.ownerManagedAccess lets that owner share it. That covers owner-and-share, one hop. It is not traversal across teams, nested groups and hierarchies, which is what the statement rule needed.This is where a central decision layer earns its place, as an addition to Keycloak rather than a replacement for it. Keymate Authorization keeps access rules as policies in one place, outside your code, and decides on every request what each user or service may do, enforcing that decision in the request path.
What matters here is that you do not pick one model for the whole company: each policy uses the model that fits the rule, and models can be combined, across role-based, attribute-based, policy-based, relationship-based, risk-adaptive and data-scoped rules. Your existing roles keep working, and you add attributes, relationships or risk only where roles stop being enough. The fine-grained authorization page goes into the object-level part.
Do not start by choosing between RBAC vs ABAC vs ReBAC. Write down ten rules your system actually needs, in the words the business uses, and match each one against the example rules in the table above. Whichever row it sounds like is the model that rule belongs in.
Keep the roles. They are the part that works, and the part auditors already understand. The useful question is narrower than the model debate: which rules live in application code today because the authorization system could not express them, and what would it take to move them out?
If you want that answered against your own rules rather than a worked example, bring three of them to a demo: the ones that do not fit the model you already have.
No. They answer different questions. RBAC decides whether someone may perform a kind of action at all, which is the right question for stable job functions. ABAC decides under which circumstances, which is the right question for rules about time, location, data classification or device. ABAC can express everything RBAC can, but writing coarse capability gates as attribute comparisons makes them harder to read and harder to review. Most systems keep roles as the outer gate and add attributes where roles stop being enough.
Yes, and that is the normal case rather than a compromise. A single request usually needs both: the role decides that a support agent may read tickets, and the attributes decide that this ticket is not from a restricted account and that the request arrived during the agent shift. The two conditions sit in one policy and are evaluated together. The practical requirement is that both the roles and the attributes reach the decision point as trustworthy inputs.
ReBAC is used wherever the right to act depends on how the user is connected to one specific object rather than on who the user is in the organization. The common cases are ownership, document and folder sharing, project or team membership, nested group hierarchies, and account structures where a parent company may see its subsidiaries. The test is whether the rule reads naturally as a chain, for example a user may edit a document if they belong to the team that owns the project the document is in.
Partly, and not as a first-class policy type. Keycloak Authorization Services ships role, user, client, client-scope, group, time, regex, aggregate and js policy types, so rules about roles, groups and time are built in. For rules that compare attributes of the user and the resource there is no built-in claim-based policy type: those are evaluated by a JAR-deployed JavaScript policy or a custom policy provider, and since Keycloak 26.6 JavaScript policies honor the scripts feature flag, so the server must be started with scripts enabled. The harder half is usually not the policy but the pipeline that keeps the attributes accurate.
Keymate Authorization keeps access rules as policies in one place, outside your code, and decides every request against them. Each policy uses the model that fits the rule.
New articles on Keycloak, authorization and running IAM in production.