Many companies need their authorization policy to correspond to their org chart. Human resources systems, recruiting and applicant tracking systems, and customer relationship management systems all require this pattern. To implement this, we want our authorization model to express authorization in terms of the relationship between two users.Documentation Index
Fetch the complete documentation index at: https://www.osohq.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
Implementation
A common model for organization hierarchies is some concept of a manager or supervisor having access to the data of their direct reports. In this example, managers should be able to see the repositories of their direct reports, as well as those reports’ reports. We use relations in Oso Cloud to implement this directly: a user has the “viewer” role on a repository if they are the manager of the repository’s creator. We also define the “manager” role recursively, so everyone in a user’s direct chain of command is considered a “manager”.- Alice creates a repository.
- All managers in Alice;s chain of command inherit the viewer role on the repository.
- Fergie, who is not in Alice’s management chain, does not receive any permissions.
Next steps
- RBAC patterns for role-based authorization
- ReBAC patterns for relationship-based authorization
- ABAC patterns for attribute-based authorization