Skip to main content
The ReBAC pattern organizes permissions based on relationships between resources. For example, granting a user access to a folder automatically grants access to its files. When to use ReBAC: You need to grant permissions on resources based on their relationship to users or other resources.

Files & folders pattern

The most common ReBAC pattern cascades permissions through nested resources like files in folders, and folders in repositories.
How it works:
  • Repository readers get reader role on all folders
  • Repository maintainers get writer role on all folders
  • Users inherit roles recursively through nested folders
  • Files inherit roles from their parent folder

User-resource relationships

Grant special permissions based on relationships between users and resources. In this example, issue creators can update their own issues, but only repository maintainers can close any issue.

Bidirectional role inheritance

Sometimes you need roles to flow both ways between resources. Child resources can inherit from parents, and parents can inherit from children. This pattern requires writing longhand rules instead of using the relations feature.

ReBAC patterns

ReBAC patterns solve complex authorization scenarios by modeling real-world relationships.

Next steps

With your ReBAC policy defined:
  1. Add facts: Store resource attributes and user context in Oso Cloud
  2. Make authorization requests: Check permissions in your application code
  3. Test scenarios: Verify policies work with different relationship combinations