SSOGEN / Learn / What Is ReBAC (Relationship-Based Access Control)?

Learn

What Is ReBAC (Relationship-Based Access Control)?

Stored relationships decide access under relationship-based access control (ReBAC): Ann is a member of eng, eng can view the handbook folder, and the folder holds the readme.

Overhead view of a round tag tied to a ring of tags, a blue thread from the ring to a folder, and a sheet in the folder
Each arrow is one stored tuple.

Each grant is stored as a relationship between an object and a user or group. A check asks “does user U have relation R to object O?” and follows those relationships to the answer. Google described the model at scale in its Zanzibar paper (USENIX ATC 2019).

Sharing a readme under RBAC, ABAC and ReBAC

doc:readme sits in folder:handbook. Ann is in group:eng, and eng can view the folder. Bob owns the readme. The same four events, decided three ways (definitions of the first two models are on RBAC vs ABAC):

Event RBAC ABAC ReBAC
Ann opens the readme Allowed if one of her roles grants view on handbook documents Allowed if a policy matches her department attribute to the document’s Allowed: Ann is a member of eng, eng views the handbook, the handbook is the readme’s parent
Bob shares the readme with contractor Carl A new role, or a one-off exception for one person and one file A shared_with attribute on the document and a rule that reads it One new tuple: doc:readme#viewer@user:carl
The readme moves to folder:archive Every role scoped to the handbook needs a review The folder attribute changes; the policy reads the new value One parent tuple is replaced; access now follows the archive’s viewers
Carl’s share is revoked Remove the exception Edit the attribute list Delete one tuple

Sharing is where the models part: a role describes a job and an attribute describes context, but neither records “Bob gave Carl this file”.

Writing relationships as tuples

Each grant is one row: object, relation, user. These five rows hold the whole example:

Relation tuples for doc:readme
doc:readme#owner@user:bob
doc:readme#viewer@user:carl
doc:readme#parent@folder:handbook
folder:handbook#viewer@group:eng#member
group:eng#member@user:ann

The format object#relation@user comes from the Zanzibar paper, which writes users as integers (doc:readme#owner@10). Typed subjects such as user:ann are the OpenFGA and SpiceDB form.

  • Direct grant. doc:readme#viewer@user:carl names one user, one relation and one object.
  • Userset. A subject such as group:eng#member means every member of eng. This is how groups, and groups inside groups, are stored.
  • Abstract relation. parent grants nothing on its own. A rewrite rule turns it into inherited access.

The paper calls each object’s set of tuples its ACL, and groups are ACLs with membership semantics. A classic access control list keeps those entries on the object itself instead.

How a check walks the graph

The paper’s Figure 1 defines three rules for documents: owners are editors, editors are viewers, and viewers of the parent folder are viewers of the document. Each rule is a union of _this (stored tuples), computed_userset (another relation on the same object) and tuple_to_userset (a relation on a linked object).

Check: does user:ann have viewer on doc:readme?

  1. Direct viewers (_this)

    Read doc:readme#viewer. The only stored viewer is user:carl. No match yet.

  2. Editors (computed_userset)

    No direct editors are stored. Owners are editors, so read doc:readme#owner: user:bob. No match.

  3. Parent folder (tuple_to_userset)

    Read doc:readme#parent and get folder:handbook. Evaluate folder:handbook#viewer.

  4. Expand the userset

    The folder’s viewer is group:eng#member. Ask whether user:ann is in it.

  5. Answer

    group:eng#member@user:ann exists. Allowed, via folder:handbook and group:eng.

The path the check found

user:annthe person asking
member of
group:engrelation: member
viewer of
folder:handbookrelation: viewer
parent of
doc:readmerelation: viewer
Each arrow is one stored tuple: group:eng#member@user:ann, folder:handbook#viewer@group:eng#member and doc:readme#parent@folder:handbook.

OpenFGA and SpiceDB, one model in two syntaxes

OpenFGA describes itself as a CNCF open source system for relationship-based access control that implements the Zanzibar model. SpiceDB describes itself as an open-source, Google Zanzibar-inspired database. Here is the readme model in each:

OpenFGA model (DSL, schema 1.1)
model
schema 1.1
type user
type group
relations
define member: [user]
type folder
relations
define viewer: [user, group#member]
type doc
relations
define parent: [folder]
define owner: [user]
define editor: [user] or owner
define viewer: [user, group#member] or editor or viewer from parent
SpiceDB schema
definition user {}
definition group {
relation member: user
}
definition folder {
relation viewer: user | group#member
permission view = viewer
}
definition doc {
relation parent: folder
relation owner: user
relation editor: user
relation viewer: user | group#member
permission edit = editor + owner
permission view = viewer + edit + parent->view
}

Both engines store the same five relationships. Only the names differ:

Concept Zanzibar paper OpenFGA SpiceDB
Stored row Relation tuple Relationship tuple Relationship
The model Namespace configuration Authorization model Schema
Inherit from a linked object tuple_to_userset viewer from parent parent->view

At Google scale, consistency was the hard part

The data model is small. The paper spends most of its pages on keeping decisions correct while ACLs change. Figures at publication (2019):

ACLs stored
More than two trillion
Checks
Millions per second
Latency
95th percentile under 10 ms
Availability
Above 99.999% over 3 years

Clients included Calendar, Cloud, Drive, Maps, Photos and YouTube.

  • The new enemy problem. Alice removes Bob from a folder, then asks Charlie to move new documents into it. A check that ignores the order of those two changes can show Bob the new documents.
  • Zookies. When content is saved, Zanzibar returns an opaque token holding a global timestamp. Later checks on that content run at a snapshot at least that fresh, so Bob’s removal is always seen.

When ReBAC is worth it, and when roles are enough

Choose ReBAC when users share objects with each other. For fixed job duties, roles stay simpler.

Your application Fits
Users share single objects: documents, projects, boards
ReBAC: one tuple per share
Objects nest in folders, workspaces or tenants, and access inherits
ReBAC: a parent relation and one rewrite rule
Access follows job duties that rarely change
Roles: fewer moving parts, simpler reviews
The decision depends on the request: time, network, amount
Attributes, or conditions and caveats on top of relationships
A central authority classifies data, and owners must not override it
Mandatory access control: labels and clearances

Group membership and delegation in SSOGEN sign-in

SSOGEN decides who opens an application. Two of the facts it weighs are relationships: group membership and an AI agent’s delegation from a person. Details are on SSO policies.

Register non-human identityActs for a person
SSOGEN non-human identity registration: Acts on its own and Acts for a person checked, a redirect URI and an expiry date
An AI agent registered to act on its own and for a person, with its redirect URI and expiry date.
  • Agent delegation. An AI agent acting for a person gets its own grant, limited to what the person approved and to what the person can reach now. SSOGEN re-checks this at every token issue and refresh.
  • Nested groups. Put Backend inside Engineering and everyone in Backend counts as a member of Engineering. Nothing is copied, so someone removed from Backend stops counting as a member of Engineering.
  • Group condition. A rule matches when the person “is in any of” or “is in none of” up to 64 groups. The first matching rule decides.
  • What if. Ask whether a person would open an application right now. The answer names the deciding rule, signs nobody in and is recorded in the audit log.

ReBAC next to Zanzibar and RBAC

What is ReBAC authorization?

ReBAC authorization allows a request when a chain of stored relationships links the user to the object. The engine holds tuples such as “eng is viewer of folder:handbook” and rules such as “viewers of the parent folder are viewers of the document”. A check walks those links and returns allowed or denied.

Is ReBAC the same as Zanzibar?

No. ReBAC is the access model; Zanzibar is Google’s system that implements it. The 2019 paper describes how Google stores relation tuples and answers checks for its services. OpenFGA and SpiceDB are separate open-source engines that follow the same data model, each with its own modeling language and API.

Is ReBAC a superset of RBAC?

OpenFGA treats it as one: any role can be written as a relation to an organization. The tuple org:acme#admin@user:ann makes Ann an admin of Acme, and one rewrite rule grants that relation’s rights on every object Acme owns, as a role would.

Can a ReBAC grant depend on context such as an IP address?

Yes, in both open-source engines. OpenFGA attaches a condition to a tuple, written in Google’s Common Expression Language. SpiceDB attaches a caveat; its schema documentation shows a reader relation that counts only when an ip_allowlist caveat is true. The relationship decides who, the condition decides when.

Sources, all read 2026-11-18: Pang et al., Zanzibar: Google’s Consistent, Global Authorization System, 2019 USENIX Annual Technical Conference (abstract, sections 1 and 2, Table 1, Figure 1); OpenFGA concepts, authorization concepts and configuration language, with the DSL checked against the OpenFGA Google Drive sample model; SpiceDB schema language and Discovering SpiceDB.

Updated