Bootstrapping root-level resources
Most Polar policies center around a root-level resource that serves as the foundation for all other resources:- Multi-tenant SaaS applications:
resource Organization
- Consumer applications:
actor User
Use the global block
Create aglobal
block that allows specific roles to create root-level resources.
global
admin role with create_org permission. Global admins can create organizations even when no other resources exist.
Next, seed your authorization facts with data providing some users the global role you defined. Typically, this will be a user of your team who should have privileges elevated beyond most other users.
For example, the above policy would require data like:
Parent-child resources
Another common pattern for authorizing resource creation is to check the parent resource’s permissions.Further resources
- RBAC patterns for role-based authorization
- ReBAC patterns for relationship-based authorization
- Facts overview for managing facts in Oso Cloud