Role Hierarchy
SwitchGuard uses WordPress role levels (0–10) to prevent privilege escalation.
Role Levels
| Role | Level |
|---|---|
| Subscriber | 0 |
| Contributor | 1 |
| Author | 2 |
| Editor | 7 |
| Administrator | 10 |
| Super Admin (Multisite) | 10+ |
Enforcement Rules
- The switching user must have the
edit_userscapability. - The target user's role level must be lower than the switcher's level.
- If Block Admin Targets is enabled, users with level 10 (Administrator) cannot be switched to, even by other administrators.