Black Friday: 30% off every plan through November 30. See the prices
SysDesignPrep.com
Study guide

Updated 24 October 2026

Authorization and permission systems

Designing who can do what: authentication versus authorization, RBAC, ABAC and relationship-based access control, Google Zanzibar-style permission services, sharing and inheritance, checking permissions fast, filtering lists, and auditing.

Reading is half of it. Now try it in an interview.An AI interviewer asks you to design Dropbox, out loud or typed, and scores the answer for your level. Or watch a sample interview first, free with no sign-up to start.
Start an AI mock

Authentication answers "who are you?"; authorization answers "may you do this?". The second is harder. "Share this folder with Alice as editor", "only workspace admins can delete channels", "followers can see this private account's posts": each product feature adds permission rules, and every request must check them quickly and correctly. Questions about Google Drive, Dropbox, Slack and Docs often include a permissions model, and getting it right avoids the most damaging class of bugs: users seeing data they should not.

Models

ModelRule shapeGood forLimits
ACLsper-resource list of (user, permission)simple sharinghard to manage at scale; no inheritance
RBAC (role-based)users have roles; roles have permissionsadmin consoles, enterprise appscoarse; role explosion for per-resource rules
ABAC (attribute-based)policies over attributes of user, resource and context"managers in the EU during business hours"policies get complex; hard to list "what can I access?"
ReBAC (relationship-based)permissions derived from relationships in a graphsharing, folders, teams, social graphsneeds a dedicated service at scale

Most products combine them: RBAC for organisation-level roles, ReBAC for sharing and inheritance, a few attribute conditions.

Relationship-based access and Zanzibar

Google's Zanzibar (behind Drive, YouTube, Calendar and more) stores relationship tuples:

doc:readme#viewer@user:alice
folder:eng#editor@group:eng-team#member
doc:readme#parent@folder:eng

and a schema of rules such as "editors are also viewers" and "viewers of a folder are viewers of its documents". A permission check ("can Alice view doc:readme?") walks this graph. Open-source systems inspired by it (SpiceDB, OpenFGA and others) offer the same model as a service. See graph data.

Benefits: one consistent model for sharing, groups, nesting and inheritance across products; centralised auditing; easy "who has access?" queries.

Making checks fast

Permission checks happen on almost every request, often many per page:

  • Cache check results briefly, and cache group memberships.
  • Precompute or denormalise deep group nesting (flattened membership) for hot paths.
  • Run checks in parallel, and batch checks for lists.
  • Keep the permission service close to the services that call it, replicated per region.

The new enemy problem

Caching and replication cause a subtle bug: Alice removes Bob from a document, then adds secret content. If the content change is checked against a stale permission replica that still lists Bob, Bob sees the secret. Zanzibar solves this with consistency tokens ("zookies"): the content write records a token, and later checks are evaluated at a permission snapshot at least as new as that token. In simpler systems, check against the primary for sensitive changes, or invalidate caches synchronously on revocation.

Filtering lists

"Show me all documents I can see" cannot check every document. Options:

  • Look up the user's accessible resources from the permission graph (reverse lookup), then fetch them.
  • Store access lists (or group ids) on resources in the search index and filter by the user's groups at query time.
  • For per-tenant data, scope by tenant first, then check within. See multi-tenancy.

Always re-check permissions on the final items, since indexes can be stale.

Where to enforce

  • At the edge or gateway: coarse checks (authenticated? has the scope for this API?). See API gateways.
  • In each service: fine-grained checks on the actual resource, never trusting the client's claims about ownership.
  • In the data layer: row-level security as a backstop.

Defence in depth matters: a single missed check in one endpoint is a data leak.

Sharing features

  • Links: "anyone with the link can view" is a relationship with a public subject or a secret token; let owners revoke and expire links.
  • Inheritance: permissions flow from folders to contents; moving a file changes who can see it, so show a warning.
  • External sharing: policies at the organisation level may forbid sharing outside the domain.

See Design Dropbox and Design Google Docs.

Auditing

Log every permission change (who granted what to whom, when) and, for sensitive resources, every access. Enterprises need access reviews ("who can see payroll?"). See security and auth.

In the interview

For a sharing product: model permissions as relationship tuples with inheritance from folders and groups, check them in a dedicated, replicated permission service with caching, handle revocation consistency, filter lists by reverse lookup or indexed access lists with a final check, and audit changes. For Slack-like products, add workspace roles (RBAC) and channel membership (ReBAC). See Design Slack.

Checklist

  • Clear separation of authentication and authorization.
  • RBAC for organisation roles, ReBAC for sharing and inheritance.
  • A central permission service with a schema of rules.
  • Fast checks: caching, flattened groups, batching.
  • Consistency on revocation (snapshot tokens or synchronous invalidation).
  • List filtering with a final per-item check.
  • Enforcement in every service, plus audit logs.

Questions people ask

What is authorization, and how is it different from authentication?

Authorization decides whether a user may do something, while authentication establishes who the user is. Authorization is the harder problem, because each product feature adds permission rules, such as "share this folder with Alice as editor" or "only workspace admins can delete channels", and every request must check them quickly and correctly. Getting it wrong causes the most damaging class of bugs: users seeing data they should not.

What is the difference between RBAC, ABAC and ReBAC?

RBAC gives users roles and roles permissions, ABAC evaluates policies over attributes of the user, resource and context, and ReBAC derives permissions from relationships in a graph. RBAC suits admin consoles but is coarse, ABAC handles rules like "managers in the EU during business hours" but makes "what can I access?" hard to answer, and ReBAC fits sharing, folders and teams but needs a dedicated service at scale. Most products combine them: RBAC for organisation roles, ReBAC for sharing and inheritance.

What is Google Zanzibar?

Zanzibar is Google's permission system, behind Drive, YouTube, Calendar and more, which stores relationship tuples such as doc:readme#viewer@user:alice plus a schema of rules such as "editors are also viewers". A check like "can Alice view doc:readme?" walks this graph. It gives one consistent model for sharing, groups, nesting and inheritance, with centralised auditing and easy "who has access?" queries, and open-source systems such as SpiceDB and OpenFGA offer the same model as a service.

What is the new enemy problem in authorization?

The new enemy problem is when a stale permission cache or replica lets a removed user see content added after their removal. Alice removes Bob from a document and then adds secret content; if the content is checked against a replica that still lists Bob, Bob sees the secret. Zanzibar prevents this with consistency tokens ("zookies"), so later checks use a permission snapshot at least as new as the write, and simpler systems check the primary or invalidate caches synchronously on revocation.

How do you make permission checks fast?

Cache check results briefly and cache group memberships, because permission checks run on almost every request, often many per page. For hot paths, precompute or denormalise deep group nesting into flattened membership. Run checks in parallel, batch checks for lists, and keep the permission service close to the services that call it, replicated per region.

Where should authorization checks be enforced?

Enforce authorization at several layers, because a single missed check in one endpoint is a data leak. The edge or API gateway does coarse checks, such as whether the caller is authenticated and has the scope for the API; each service does fine-grained checks on the actual resource, never trusting the client's claims about ownership; and row-level security in the data layer acts as a backstop.