Detection
Role Mapping
Detection
Role Mapping
Before testing authorization, first build a matrix that maps every role against every sensitive action the application exposes. This defines the expected authorization behavior and gives the tester something concrete to test against.
Action | user | editor | admin
--------------------|------|--------|------
view own profile | yes | yes | yes
edit own post | no | yes | yes
edit any post | no | no | yes
delete user account | no | no | yesThe matrix should also capture ownership or contextual conditions where permissions aren't determined by role alone:
Action | Condition
--------------------|-----------------------------
edit post | user owns the post
edit post | admin can edit any post
view invoice | user belongs to its tenant
delete user | requester has admin permissionThis matters because:
role = editor
↓
Does NOT automatically mean
↓
can edit every postThe actual rule might be:
editor + owns post → allow
editor + does not own post → deny
admin + any post → allowOnce the expected rules are written down, testing becomes systematic:
Role / Context
↓
Action
↓
Expected: allow or deny?
↓
Send request
↓
Actual: allow or deny?
↓
CompareWithout this mapping, authorization testing becomes guesswork. You might verify that ordinary users cannot access the admin panel while completely missing that an editor can modify another user's content.