An editor can change project briefs. Should that also let them export every brief, approve an invoice or edit another customer's project?
A single role column works while those answers move together. Once customers need different answers, adding another role name often hides the missing distinction.
Consider a fictional project tracker. Northwind hires Maya to edit briefs for its Launch project. Robin handles invoice approval. Both need to change something, but an account-wide Editor role would give each person access intended for the other.
Start with the requests that must succeed and fail
Write the access requirements before changing the roles:
| Person | Request | Required result |
|---|---|---|
| Maya | Edit a brief in Launch | Allow |
| Maya | Edit a brief in another Northwind project | Refuse |
| Maya | Export all Northwind briefs | Refuse |
| Robin | Approve a Northwind invoice | Allow |
| Robin | Change Northwind's payment details | Refuse |
| Either | Open another customer's private work | Refuse |
“Northwind editor” cannot express this matrix on its own. The decision needs to distinguish the operation, the resource and the place where the assignment applies.
Separate a role's contents from its assignment
Define two reusable bundles:
| Role | Actions | Resource type |
|---|---|---|
| Project editor | Read, edit | Brief |
| Invoice approver | Read, approve | Invoice |
Then assign Project editor to Maya at Launch and Invoice approver to Robin at Northwind's billing workspace. These are example names and application choices.
The Project editor definition can be reused in another project. Its assignment supplies the scope. There is no need to create a different role definition for every combination of person and project.
Joining Northwind is a separate relationship. Membership establishes which customer organization a person belongs to; the scoped assignments establish what they may do there. The modeling guide explains how saaslayer represents those pieces.
Fictional project tracker. This runs a small illustrative rule in your browser; your application must enforce real access on its server.
Follow one edit through the backend
Maya submits an edit for brief-launch. The backend verifies her session and loads that brief from application data. The stored brief identifies Launch as its workspace. A workspace ID supplied by the browser cannot establish that relationship.
With the sample catalog and assignments above, the backend can ask saaslayer Permissions:
{
"userId": "maya",
"action": "edit",
"resource": "brief/brief-launch",
"product": "project-tracker",
"service": "projects",
"scope": "ws-northwind-launch"
}This is a request body for POST /permissions/check. The backend authenticates the call using its authorized service credential. The example's product, service, resource type and actions must be declared in the application's catalog; the body alone does not create access.
Proceed only when data.attributes.allowed is true. Then validate the edit itself. An allowed editor may still be unable to change a finalized brief because of an application rule.
Repeat the request with a brief whose actual workspace is another project. With only Maya's Launch assignment, the required result is refusal. Test this through the backend that loads the resource, so a passing check also covers the connection between the requested record and its scope.
Add a permission when the work changes
If Maya later needs exports, decide what an export contains. Exporting one brief, a project or every customer record are different operations. An edit assignment should not implicitly authorize all three.
Adding export to the shared Project editor role would affect everyone assigned that role where the permission applies. A separate export assignment may fit better when only a few people need it.
Keep the request matrix beside the feature specification. It gives the next role change something concrete to preserve: the operations that should work and the boundaries that should remain.