Permission bugs are the quiet kind. Nothing crashes, nothing shows up in a log, and every test passes with the admin account you used to set things up. Then a guest opens a link they should never have seen. In work management software, where tasks, clients, files and billing live side by side, that is a real problem.
This post walks through a simple way to test roles and permissions: a matrix you can fill in on a whiteboard, test in three ways and then automate. It works for any app with roles, not just task tools.
Why permission bugs hide
Most testing happens as one user, usually the most powerful one. The "happy path" is also the "admin path". Meanwhile, the real risks sit in the gaps:
- A button is hidden in the UI, but the API still accepts the request.
- A role is changed, but an open session keeps the old access.
- A guest can't open a project, but can still find it through search or a notification.
You won't catch these by clicking around. You need a structure.
Step 1: List your roles and your actions
Start with two lists. Roles are usually something like Owner, Admin, Member and Guest. In many tools the Owner has every permission by definition and can't be edited, which makes it easy to skip. Test it anyway, because it is the role whose actions do the most damage.
Actions are the things a user can do: view a project, create a task, edit someone else's task, delete a task, invite a person, change a role, export data, manage billing, delete the workspace.
Keep actions concrete. "Manage tasks" is too vague to test. "Delete a task created by another member" is a test case.
Step 2: Build the matrix
Put actions in rows and roles in columns, then write down the expected result before you test anything. Here is an example. These are illustrative expectations, so replace them with your product's actual rules.
| Action | Owner | Admin | Member | Guest |
|---|---|---|---|---|
| View a project | Yes | Yes | Yes | Shared items only |
| Create a task | Yes | Yes | Yes | No |
| Edit another person's task | Yes | Yes | Per rule | No |
| Delete a task | Yes | Yes | Own only | No |
| Invite a member | Yes | Yes | No | No |
| Change a role | Yes | Yes (not Owner) | No | No |
| Export data | Yes | Yes | Per rule | No |
| Manage billing | Yes | No | No | No |
| Delete the workspace | Yes | No | No | No |
Writing the expected result first matters. If you test first, you will end up approving whatever the app does.
Anything marked "per rule" is a question for your product owner. A blank answer there is already a finding.
Step 3: Test every cell three ways
For each cell, check the same action through:
- The UI. Is the control hidden or disabled when it should be?
- The direct URL. Paste the address of a restricted page while logged in as the wrong role.
- The API. Send the request without the UI. This is the one that matters most, because the UI is only a suggestion.
A permission is only real when the server refuses the request. For a blocked action, look for a clear 403 (or 404 if you hide the resource's existence), and make sure nothing changed in the data.
Step 4: Check the edge cases people forget
The matrix covers the obvious cases. These cover the ones that leak:
- A role change mid-session. Demote a user while they are logged in. Does the next request fail?
- A removed member. Can they still open old links, or receive notifications?
- The last Owner. What happens if they leave, or are demoted?
- Search, exports and notifications. Restricted items often show up here first.
- Invite links. What role does a new person get, and can that be changed by editing the request?
- Comments and attachments. Access to a task should control access to everything inside it.
Step 5: Use what the product gives you
Well-built work management software makes the matrix easier to build and easier to check. Here is what to look for, and the test each feature suggests.
- A permissions grid you can read. When permissions are grouped by module in one grid, with roles as columns, you get most of your matrix for free. Screenshot it and compare it with your expected table. Every difference is either a bug or a documentation gap.
- Sensitive permissions that are flagged. Some tools mark risky actions, such as deleting a project, as sensitive. Test those cells first, and test them hardest.
- Switches that are never offered. A good tool won't show a Guest a permission they can never have, and the grid may show those cells as "not applicable" rather than off. That removes cells from your UI testing, but it is still only a UI promise. Send the request to the API anyway.
- Custom roles. Once you can write your own role, the matrix grows. Test at least one custom role with a mix of allowed and denied actions, then edit the role and check that people already holding it get the new access straight away.
- A role chosen at invite time. Check that the invited role is the role the person gets. If pending invites can be resent or revoked, check that a revoked or expired invite no longer works.
- Role changes at any time. If a role can be changed from the member list, test the change both ways, up and down, and look at what the person can do before and after.
- An audit log for access changes. If the product records who did what and when, use it as test evidence. Change a role, then confirm the change appears with the right person and time.
- Shares that expire. If access can expire after a set time, test the boundary: one moment before and one moment after.
Step 6: Automate the matrix
Once the matrix is a table, it can become data. Here is a sketch in TypeScript with Playwright. The endpoints and auth files are placeholders, so adapt them to your app.
import { test, expect } from '@playwright/test';
type Role = 'owner' | 'admin' | 'member' | 'guest';
const roles: Role[] = ['owner', 'admin', 'member', 'guest'];
const cases = [
{ name: 'create a task', method: 'POST', path: '/api/tasks',
allowed: ['owner', 'admin', 'member'] },
{ name: 'invite a member', method: 'POST', path: '/api/invitations',
allowed: ['owner', 'admin'] },
{ name: 'manage billing', method: 'GET', path: '/api/billing',
allowed: ['owner'] },
];
for (const c of cases) {
for (const role of roles) {
test(`${role} ${c.allowed.includes(role) ? 'can' : 'cannot'} ${c.name}`,
async ({ playwright }) => {
const api = await playwright.request.newContext({
storageState: `auth/${role}.json`,
});
const res = await api.fetch(c.path, { method: c.method, data: {} });
if (c.allowed.includes(role)) {
expect(res.status()).not.toBe(403);
} else {
expect([401, 403, 404]).toContain(res.status());
}
});
}
}
Each new row in the table becomes a new test, and a failing test shows exactly which role and action broke.
Step 7: Keep the matrix alive
A permission matrix goes stale the day a feature ships. Add one rule to your process: any new feature that adds an action also adds a row. Review the whole table whenever you add a role. It takes ten minutes and prevents the kind of bug that is hard to explain to a customer.
Wrap-up
Test the rule, not the screen. List the roles, write the expected results first, check each cell through the UI, the URL and the API, and then turn the table into tests. Use whatever your work management software offers, like a readable grid, flagged permissions and an audit log, as evidence rather than as proof.

Top comments (0)