Permission Matrix Drafting
Draft the endpoint-by-actor expectation matrix before running a single test, so results are judged against a written expectation
Use when: you have an endpoint inventory and actor list and need an executable statement of what each combination should return
Avoid when: you are doing exploratory testing where writing expectations first would only slow discovery down
Procedure
- Start from the endpoint inventory and the actor catalog produced by the mapping phase.
- Assign each endpoint an auth layer: public, authenticated, role-restricted or tenant-restricted.
- Write the expected status for every endpoint-actor pair, choosing deliberately between 401 and 403 and documenting why.
- Add object-level expectations for endpoints that operate on a specific object, including the peer-owned case.
- Flag combinations you cannot predict, since those mark places where the requirement is genuinely unclear.
- Save the matrix as a spec file so the tooling can render it and your results can be compared against it.
Signals
- Two endpoints handling the same resource expect different statuses for the same actor, which suggests inconsistent design.
- You cannot predict an expectation without asking the team, which reveals an undocumented requirement.
- The spec contains an endpoint with no object-level expectation while clearly operating on one object.
- Every cell is 200, which usually means the auth layer was never actually classified.
Patterns
1. Matrix cell
GET /api/orders x actor=anonymous -> 401 (no credential presented)
GET /api/orders x actor=member -> 200 (own data only)
2. Layer rules
auth=none -> 200 for all
auth=session -> 401 anonymous, 200 member
auth=admin -> 401 anonymous, 403 member, 200 admin
object=yes -> peer-owned object must be 403 or 404
3. Spec file
{"name":"demo-api","actors":[...],"endpoints":[{"path":"/api/orders","auth":"session","object":true}]}
Pitfalls
- Writing the matrix after testing, which turns expectations into rationalizations instead of predictions.
- Using 200 everywhere because it is easy, hiding every distinction the review exists to find.
- Omitting the peer-owned object row, which is precisely where object-level authorization failures show up.
Done when
- Every endpoint-actor cell has a written expected status, and every object endpoint has a peer-owned expectation.
- The matrix loads as a spec file and renders through the matrix command without manual editing.