Files & folders pattern
The most common ReBAC pattern cascades permissions through nested resources like files in folders, and folders in repositories.- 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 therelations
feature.
ReBAC patterns
ReBAC patterns solve complex authorization scenarios by modeling real-world relationships.Pattern | Description |
---|---|
User groups | Controlling permissions by membership in a group |
Impersonation | Allowing one user to inherit a subset of another user’s permissions |
Organization hierarchies | Cascading permissions through user relationships |
Next steps
With your ReBAC policy defined:- Add facts: Store resource attributes and user context in Oso Cloud
- Make authorization requests: Check permissions in your application code
- Test scenarios: Verify policies work with different relationship combinations