User Roles and Permissions Matrix Template with Negative Tests
Document user roles, tenant boundaries, record ownership and permitted actions. Turn the permissions matrix into useful negative tests for application security.
A user roles and permissions matrix describes what each identity may do to each relevant resource. It gives developers, testers and business owners a shared specification for access control.
Role names alone are rarely enough. Permission can also depend on tenant membership, record ownership, account status, delegated authority and the state of a business process.
Define the dimensions first
List the user and service identities that reach the application, including ordinary users, support staff, administrators, integrations and background workers. Identify the resources and sensitive actions they can request.
For each action, describe the conditions that grant access. Avoid an ambiguous “yes” where the real rule is “only records in the active tenant, after approval and before closure”.
Use a reusable matrix
The following rows are illustrative requirements for a fictional customer portal. Replace them with the actual business rules before using them as acceptance criteria.
| Actor | Resource and action | Permitted conditions | Required negative case |
|---|---|---|---|
| Customer user | Read an invoice | Active membership in the invoice's tenant and read permission. | A known invoice in another tenant returns no content. |
| Read-only user | Change an invoice | Not permitted. | Direct update requests leave the record unchanged. |
| Accounts approver | Approve a payment | Appropriate tenant, approval role and eligible transaction state. | An ineligible or already processed transaction is not approved again. |
| Support user | Access customer records | Explicitly authorised support workflow with suitable audit. | A guessed identifier does not grant unrestricted access. |
| Background worker | Process an export | Valid job context, tenant scope and permitted operation. | A supplied record list cannot escape the authorised scope. |
Add the owner of each rule, the implementation point and the relevant test reference. Keep secrets and live personal data out of the matrix.
Include less visible operations
Cover list and search results, bulk actions, exports, downloads, notifications and asynchronous jobs. A secure detail page does not protect an export endpoint that accepts arbitrary identifiers.
Review both response fields and writable fields. A user may be permitted to update a display name without being allowed to change an owner, role, approval flag or billing reference.
Translate rules into tests
Prepare at least the identities and controlled records needed to exercise the intended boundaries. For tenant separation, this usually requires more than one tenant and a known record in each.
Check the response and the resulting state. After a refused operation, verify that no record changed, file was issued or external action was queued where the rule requires that outcome.
Test lifecycle changes
Review what happens after logout, suspension, role removal, tenant departure and permission changes. Cached decisions, active sessions and issued download links may have different lifetimes.
Where immediate revocation is required, specify that requirement and verify the full access path. Do not assume that changing one database flag invalidates every existing token or background job.
Maintain the matrix with the product
Have a business owner approve the intended rules and a technical owner maintain the implementation and tests. Review changes to roles, integrations and sensitive workflows before release.
Use penetration testing to investigate whether the deployed service honours the matrix through alternate requests and connected paths. Feed confirmed gaps back into shared permission controls and regression tests.
Related resources
Read our testing methodology or discuss your assessment.