Skip to content

Interview question · Identity, OAuth & Access Control

RBAC, ABAC or relationship-based access control: design authorization for a document product.

Documents are shared with people, folders, teams and links. Roles alone collapse under that, and the interviewer wants to see you notice when.

mediumNewPreparation tags: Google, Microsoft, SalesforceUpdated Nov 2026

TL;DR: RBAC grants permissions to roles; it is simple and fits organisation-wide privileges (admin, billing). ABAC evaluates attributes of user, resource and context; it fits rules like "same department, during business hours, non-confidential". ReBAC derives access from relationships (owner, editor of this document, member of the folder's team); it fits sharing models like documents. For a document product, use ReBAC for document access, RBAC for administrative functions, and ABAC conditions for policy overlays such as classification or device posture, all evaluated centrally on every request.

How to approach it

Start from the product's sharing model: who can share what with whom, and how access inherits through folders and teams. Show where pure RBAC breaks, then build the hybrid. Address performance and consistency, since that is where real systems struggle.

A strong answer

FIG · ACCESS MODELS · WHAT THE DECISION DEPENDS ON
Roles, attributes or relationships
  1. RBAC

    Permission via role

    • admin, billing, support
    • Simple; explodes with fine-grained needs
  2. ABAC

    Rules over attributes

    • Same department, business hours, data class
    • Expressive; harder to audit
  3. ReBAC

    Access from relationships

    • Owner of this doc, member of that folder
    • Fits sharing models; needs a relationship store

Where RBAC breaks. Roles answer "what can editors do?" but not "is Alice an editor of this document?" Modelling per-document access with roles creates a role per document per permission, which explodes. RBAC still works well for global functions: workspace admin, billing admin, auditor.

Where ABAC fits. Rules over attributes: "confidential documents may not be opened from unmanaged devices", "contractors cannot export". Expressive, but hard to answer "who can see this document?" for audits, and policies can become opaque.

Where ReBAC fits. Access as a graph of relationships: Alice is an editor of doc-1; doc-1 is in folder-F; members of team-T are viewers of folder-F; Bob is a member of team-T. "Can Bob view doc-1?" is a graph walk. Google's Zanzibar paper (2019) described this model at scale, and open-source systems such as OpenFGA and SpiceDB implement it.

A hybrid design.

LayerModelExample rule
Document and folder sharingReBACviewer if direct viewer, or editor, or viewer of parent folder, or member of a team with access
Administrative functionsRBACWorkspace admins can manage members and policies
Policy overlaysABACConfidential documents require a managed device; external users cannot download

Engineering concerns.

  • Central decision point. One authorization service or library answers check(user, action, resource); every endpoint calls it, including search and export paths.
  • Search and listing. Filter results by permission inside the query or index, not after fetching, or you leak titles, counts and timing.
  • Consistency. After a share is revoked, stale caches must not keep granting access; Zanzibar's approach uses consistency tokens so checks are at least as fresh as the change.
  • Auditability. Support "who can access this?" and "why can Alice see this?" queries.

AI features. A RAG assistant over these documents must apply the same check at retrieval time with the requesting user's identity, or it becomes a way around the whole model.

What interviewers probe next

  • "Link sharing: anyone with the link can view. How does that fit?" Model the link as a principal or a capability with its own relationship and expiry, revocable independently.
  • "How do you keep check latency low?" Cache relationship lookups with bounded staleness, precompute group memberships, and colocate the authorization service.
  • "How would you test this?" A matrix of principals and resources with expected outcomes, run on every change to policy code.

What if?

What if · interview follow-ups

Hold your answer as the constraints change

A document collaboration SaaS is outgrowing simple role-based permissions as customers ask for sharing, folders, teams and classification rules.

  1. Start here

    What does each model fit?

How it's scored

Weak: Picks RBAC for everything, or defines the acronyms without a design.

Hire: Matches each model to the part of the product it fits, with a central check.

Strong Hire: Covers inheritance, search filtering, revocation consistency and auditability, and extends it to retrieval for AI features.

Common mistakes

  • Filtering search results after retrieval.
  • Role explosion from per-object roles.
  • Caching authorization decisions without a revocation story.
  • AI retrieval paths that bypass the authorization service.
You just read a free answer. Every topic opens its first 5 answers to anyone. Sign in and the count per topic goes to 10, and we keep track of how far you get in every topic.Google sign-in · free · no payment details
HOW DID IT GO?
0
READING SIGNED OUT

Signing in doubles your free answers, from 5 to 10 per topic, and the site starts remembering you: mastery per topic, bookmarks, and a next-focus recommendation. Free, no card.

Sign in free
UP NEXT ON YOUR JOURNEY
DISCUSSION · 0

No comments yet. Share a correction or a different way to answer it.