Course contentsShow
← Security
Lesson 800 of 3,05217. Web Security - Authorization and Access ControlFree lesson

Relationship-Based Access Control (ReBAC)

Access control based on relationships between entities, common in social and collaborative applications.

What You'll Learn

You'll discover how access control can be governed by the relationships between users and resources, rather than just roles or attributes.

What is Relationship-Based Access Control?

Relationship-Based Access Control (ReBAC) determines whether a user can access a resource based on their relationship to that resource or its owner. Instead of asking "What role does this user have?" (RBAC) or "What attributes does this user possess?" (ABAC), ReBAC asks "How is this user connected to this resource?"

Think of it like social media: You can see Alice's vacation photos because you're her friend. You can edit the project document because you're a team member. You can comment on the post because you're a follower. The relationship defines the permission.

How ReBAC Works

ReBAC models your system as a graph of relationships:

  • Entities: Users, documents, organizations, groups
  • Relationships: "friend of," "member of," "owner of," "parent of"
  • Permissions: Derived by traversing these relationships

For example:

  • Bob can view a document because he's a member of Team A, and Team A owns the document
  • Carol can edit a photo because she's tagged in it and the owner allows tagged users to edit

When to Use ReBAC

ReBAC excels in social networks, collaborative platforms, and hierarchical organizations where:

  • Resources have owners or belong to groups
  • Permissions depend on multi-hop relationships (friend-of-friend)
  • The structure is naturally graph-like

Common examples: Google Drive sharing, Facebook privacy controls, GitHub repository permissions.

Challenges

ReBAC can become complex when relationship chains grow deep, and performance may suffer if relationship graphs aren't optimized.

Key Takeaway: ReBAC grants access based on how users are connected to resources through relationships, making it ideal for social and collaborative applications where context matters more than static roles.