Model Your Authorization
Good authorization models start with product workflows, not database tables. Before creating roles, list the decisions your app needs to make:
- Can this user view this page?
- Can this user update this record?
- Can this user invite another user?
- Can this user approve a high-value operation?
- Can this service account call this internal API?
Then map those decisions to principals, resources, actions, and scopes.
How the pieces relate
Organizations, workspaces and groups describe where people belong. A role is a reusable bundle of permissions, defined separately from that container tree.
In this example:
- Membership: Maya belongs to the Engineering group within App production.
- Role definition: Project editor bundles the permissions to read projects and edit tasks. The definition sits outside the organization/workspace/group hierarchy.
- Assignment: Maya gets Project editor at the App production scope. That assignment doesn't give her the role in every other workspace.
The same role definition can be used for another person's assignment, or for another workspace's scope. Joining a group doesn't automatically assign a role; membership and permission assignment are separate.
This picture shows a common nesting pattern. Groups can also live directly under an organization, under another group, or at the root. The hierarchy guide describes the supported layouts.
Start with workspaces
Use an organization for a customer account, with workspaces for its projects, environments or other subdivisions. A person can be an admin in one workspace and a viewer in another.
Assign product roles at the workspace scope. The scope value is the workspace ID:
{
"principalType": "USER",
"principalId": "user-alice",
"roleId": "role-admin",
"scope": "ws-acme-prod"
}Use global roles only for deployment-wide administration or automation that genuinely needs access across workspaces.
The public name is workspace, and its API is /workspaces. Older internals still use TENANT, and generated workspace IDs retain the tnt_ prefix. The rename does not require you to change existing IDs.
Keep roles coarse and policies precise
Roles should describe responsibilities:
workspace-adminbilling-managersupport-viewerdevice-operatorauditor
Policies should describe rules:
- Owners can edit their own drafts.
- Invoices over 10,000 require finance approval.
- Production resources cannot be deleted by support.
- Exports are allowed only from corporate IP ranges.
If a role name includes a condition, such as invoice-approver-under-5000, that condition probably belongs in a policy.
Prefer product actions
Avoid modeling API implementation details as permissions. POST /invoices/:id/void may be the route, but the permission should be:
action: void
resource: invoice
service: billingThis keeps authorization stable when your API changes.
Use groups for teams and inheritance
Groups are useful when users need access because of team membership.
Examples:
- Engineering group gets read access to staging resources.
- Finance group can approve invoices.
- A regional support group can view only workspaces in its region.
Groups should not replace roles. A group answers "who belongs together?" A role answers "what can they do?"
Use denies for hard stops
Deny rules are powerful because they override allows. Use them for constraints that should win over every other assignment.
Good deny use cases:
- Block destructive actions in production.
- Prevent support users from exporting customer data.
- Stop inherited admin roles from performing billing changes.
Poor deny use cases:
- Replacing normal role design.
- Encoding every exception as a deny.
- Hiding unclear ownership rules.
Plan for change propagation
Role, policy, and hierarchy changes may affect many principals. SaaSLayer Permissions handles permission rebuilds and cascades, but you should still design for understandable blast radius.
Before making broad changes:
- Preview delete impact when available.
- Use dry-run operations where supported.
- Prefer changesets for multi-step updates.
- Watch audit and permission history after rollout.
A good first production model
Start with:
- One organization per customer.
- One workspace per project, environment or other subdivision that needs its own access scope.
- A small set of roles per workspace, based on what people need to do.
- Policies only for conditions that roles cannot express.
- Direct grants only for explicit sharing workflows.
- Access requests only for elevated or temporary permissions.
This model is simple enough to explain and strong enough to grow.