Access control explained
First prove who you are, then the system decides what you're allowed to touch.
Access control has two halves: authentication proves identity, authorization decides permissions. The authorization models form a ladder of expressiveness — ACLs list who can touch each object, RBAC grants permissions through roles, ABAC evaluates attributes and policies, and ReBAC follows relationships between entities. Over all of them sits one principle: least privilege — grant only what's strictly needed.
Authenticate first
Before any permission question makes sense, the system must establish identity — verifying a password, a token, a passkey, or a second factor. Authentication produces a trusted answer to 'who is this?' Everything downstream builds on it, which is why a weak authentication step undermines every model above it.
Then authorize
With identity established, authorization decides what that identity is permitted to do: read this record, delete that file, call this admin endpoint. Authentication and authorization are distinct steps — being logged in is not the same as being allowed — and conflating them is a classic source of security bugs.
ACL — per-object lists
The most granular model attaches to each resource a list of exactly which users or groups may perform which actions on it — like Unix file permissions. ACLs are precise and easy to reason about for one object, but they scale badly: managing thousands of per-object lists across many users becomes an administrative nightmare.
RBAC — permissions via roles
Role-Based Access Control adds a layer of indirection: permissions attach to roles (admin, editor, viewer), and users are assigned roles. You manage a handful of roles instead of millions of user-permission pairs, which is why RBAC is the default for most business applications. Its limit is rigidity when access depends on context.
ABAC — attributes + policies
Attribute-Based Access Control evaluates rules over attributes of the user, the resource, and the environment: 'allow if department == owner-department AND time is business hours AND request is from the corporate network.' It's far more expressive and dynamic than roles, at the cost of policies that are harder to author, audit, and reason about.
ReBAC — follow relationships
Relationship-Based Access Control derives permission from the graph of relationships between entities: you can edit a document because you are its owner, or view a folder because you're a member of the team that owns it. Popularized by Google Zanzibar, it excels at the 'shared with', 'member of', 'parent of' access that social and collaboration apps need.
Least privilege over all
Whichever model you choose, the governing principle is least privilege: every user, service, and token gets the minimum access required for its job and nothing more. Tight defaults shrink the blast radius when credentials leak or code is compromised, turning a total breach into a contained one.
Two questions, always in order
Access control is the discipline of ensuring that entities can only do what they're permitted to do, and it always decomposes into two distinct questions asked in a fixed order.
Authentication asks *"who are you?"* — it establishes and verifies identity, whether by a password, a one-time code, a passkey, an API key, or a signed token. Authorization asks *"what are you allowed to do?"* — given a verified identity, it decides whether this particular action on this particular resource is permitted.
The order is not negotiable: you cannot decide what someone may do until you know who they are, so authentication always comes first and authorization builds on its result. Keeping the two crisply separated is more than pedantry — a huge class of real vulnerabilities comes from conflating them, treating "the user is logged in" as if it meant "the user is allowed." A logged-in user editing *someone else's* record is authenticated but not authorized, and forgetting to make that second check is one of the most common and damaging web security bugs there is (broken access control sits at the top of the OWASP risk list).
ACL — the granular baseline
The most direct way to express authorization is an Access Control List: attach to each resource a list of exactly which identities may perform which actions on it. Unix file permissions are the everyday example — each file records what its owner, group, and others may read, write, or execute — and network firewalls, S3 bucket policies, and shared-document permissions all use the same idea.
ACLs are wonderfully precise. For a single object you can see at a glance exactly who has access and revoke any one entry cleanly. The problem is that precision doesn't scale. When you have thousands of resources and thousands of users, you end up maintaining an enormous, sprawling matrix of per-object entries. Answering an organizational question like "what can this employee access?" means scanning every object's list, and onboarding or offboarding a person means touching access lists all over the system. ACLs are the right tool for a bounded set of objects, but their administrative cost is what motivated every richer model that follows.
RBAC — managing access through roles
Role-Based Access Control tames the ACL explosion with one layer of indirection. Instead of granting permissions to users directly, you define roles — admin, editor, viewer, billing — attach permissions to those roles, and then assign roles to users. A user's effective permissions are simply the union of their roles' permissions.
The payoff is administrative sanity. You manage a small, stable set of roles rather than a combinatorial mess of individual grants; onboarding becomes "give them the editor role," and changing what all editors can do is a single edit in one place. This maps naturally onto how organizations already think — by job function — which is why RBAC is the default model in the overwhelming majority of business applications and platforms.
RBAC's limitation is rigidity. Roles are coarse and static, so when access needs to depend on *context* — the specific record, the time of day, the requester's location, ownership — you either bloat the system with hyper-specific roles ("editor-of-region-3-during-business-hours") or you hit RBAC's ceiling. That pressure is exactly what the next models relieve.
ABAC and ReBAC — richer, dynamic decisions
Two models push beyond roles when access must be more dynamic.
Attribute-Based Access Control (ABAC) makes decisions by evaluating policies written over attributes: attributes of the user (department, clearance, employment status), of the resource (owner, classification, project), and of the environment (time, IP, device posture). A policy reads like a rule — "permit if user.department == resource.department AND request.time is within business hours AND request.network == corporate." This is enormously expressive and context-aware, capable of fine-grained decisions no fixed role could capture. The cost is complexity: policies can be hard to author correctly, expensive to evaluate, and difficult to audit, because reasoning about "who can access this?" now means simulating the policy engine rather than reading a list.
Relationship-Based Access Control (ReBAC) derives permission from the relationships between entities, modeled as a graph. You may edit a document because you have an owner relationship to it; you may view a folder because you're a member of the team that has a parent relationship to it. Google's Zanzibar system popularized this approach for exactly the "shared with," "member of," "commenter on" access patterns that dominate collaboration and social products, where permissions naturally flow along connections between objects rather than from static labels on users.
Least privilege ties it together
No matter which model you deploy, one principle governs all of them: the principle of least privilege. Every identity — human user, service account, API token, background job — should be granted the minimum set of permissions required to do its job, and not one grant more. Access should default to *denied* and be opened only where a concrete need exists.
The reason is blast-radius control. Credentials leak, tokens get stolen, code gets compromised, and insiders make mistakes. When that happens, the damage is bounded precisely by what the compromised identity was allowed to do. An over-privileged service account that could read the entire database turns a small breach into a catastrophe; a tightly-scoped one that could touch only its own table turns the same breach into a contained incident. Least privilege is why you scope tokens narrowly, prefer read-only access where writes aren't needed, expire and rotate credentials, and audit for the permission creep that accumulates as people change teams.
In practice these ideas combine rather than compete. A real system authenticates strongly, uses RBAC as its backbone for coarse organizational access, layers ABAC policies or ReBAC relationships where finer or contextual decisions are needed, and enforces least privilege throughout — so that the everyday question "should this request be allowed?" always has a clear, auditable, and deliberately conservative answer.
Authentication answers 'who are you?'; authorization answers 'what may you do?' — always in that order.
ACL: each resource carries a list of which users or groups may perform which actions on it.
RBAC: permissions attach to roles, users get roles — the standard model for most business apps.
ABAC: decisions come from evaluating attributes (user, resource, context) against written policies.
ReBAC: permission derives from relationships between entities — 'owner of', 'member of', 'parent of'.
Principle of least privilege: every identity gets the minimum access needed, and nothing more.
Quick quiz
What is the difference between authentication and authorization?
In RBAC, how do users receive permissions?
How two-factor authentication works
A password can be stolen. A second, independent factor is much harder to steal too.
Sessions, cookies, JWT & OAuth 2.0
How a server remembers who you are — and who let you in.
JWT explained
A signed, self-describing token that lets a server trust a request without looking anything up.
Top tips for API security
An API is a door into your data — these are the locks every one of them needs.