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