Role-Based Access Control (RBAC) & Scope Permissions
Simulate realistic multi-tenant authorization workflows, test custom OAuth scopes, inspect descriptive 403 Forbidden payloads, and validate frontend permission guards without running complicated identity servers.
Interactive RBAC & Scope Permissions Studio
403 SimulatorSimulate role hierarchies, custom OAuth scopes, and test 403 Forbidden enforcement in real-time.
No Requests Dispatched Yet
Choose a role and action on the left, then click "Dispatch Request" to test 403 Forbidden vs 200 OK.
When X-Simulate-Role: viewer or custom scopes are sent, any mutating actions (POST/PATCH/DELETE) automatically produce realistic 403 Forbidden envelopes to test your app's UI error toasts and route guards.
Full root access. Can read, create, update, delete any entity, and reset isolated session sandboxes.
admin / admin123Can read, create, and modify posts, comments, and todos. Destructive deletes return 403 Forbidden.
editor / editor123Strictly read-only access. Any mutating request (POST, PUT, PATCH, DELETE) yields a 403 Forbidden.
viewer / viewer123Unauthenticated or public-only caller. Protected endpoints (like /auth/me) return 401 Unauthorized.
guest / (no token)Default Permission Matrix
| Action / Resource | Admin | Editor | Viewer | Guest | Required Scope |
|---|---|---|---|---|---|
| GET /posts, /users, etc. | ✅ Allowed | ✅ Allowed | ✅ Allowed | ✅ Allowed | *:read, posts:read |
| POST /posts, /comments | ✅ Allowed | ✅ Allowed | ❌ 403 Forbidden | ❌ 403 Forbidden | *:write, posts:write |
| PATCH /posts/:id | ✅ Allowed | ✅ Allowed | ❌ 403 Forbidden | ❌ 403 Forbidden | *:write, posts:update |
| DELETE /posts/:id | ✅ Allowed | ❌ 403 Forbidden | ❌ 403 Forbidden | ❌ 403 Forbidden | posts:delete, admin |
| DELETE /session/reset | ✅ Allowed | ❌ 403 Forbidden | ❌ 403 Forbidden | ❌ 403 Forbidden | admin only |
| GET /auth/me | ✅ Allowed | ✅ Allowed | ✅ Allowed | ❌ 401 Unauthorized | authenticated |
Integration Recipes & Usage
1. Simulation Headers (Zero Login Required)
Pass X-Simulate-Role and optional X-Simulate-Scopes directly in your fetch or Axios requests to instantly simulate unauthorized behavior.
2. Query Parameter Overrides
Append ?_role=viewer&_scopes=posts:read to any URL for simple GET requests, browser testing, or image tags.
3. Official TypeScript SDK
Use client.setRole() or login with built-in personas in test suites.
4. React & Next.js Route Guard Testing
Validate that your UI conditionally hides buttons (e.g. "Delete Article") or renders access denied banners when the user lacks required capabilities.
Programmatic RBAC Discovery Endpoints
Returns all supported roles, their descriptions, default scopes, and test credentials.
Returns the granular permission matrix, allowed HTTP actions per role, and wildcard matching patterns.