role_switcher_session
Role Switcher lets any logged-in user who holds multiple custom roles pick which single role is active for their current browser session — without modifying the database or requiring any admin involvement.
Features
- Users can switch between their assigned custom roles from a dropdown block
- Session-based switching — no database changes, no permanent role modification
- "All my original roles" option instantly reverts to full original role set
- Administrator role is never lost — lockout-proof by design
- Block auto-placed in header on install — zero manual Block Layout setup
- Works transparently with all Drupal access checks (routing, Views, Twig, custom access checkers)
- Per-session switching — different browsers are fully independent
- Compatible with Drupal 10 and Drupal 11
Post-Installation
No configuration required. After enabling the module:
1. The "Role Switcher" block appears automatically in the header region
2. Any user with 2 or more custom roles will see an "Acting as" dropdown
3. Select a role to switch — or select "All my original roles" to revert
4. Logging out always resets to the full original role set
Additional Requirements
No additional modules or libraries required. Only Drupal core (drupal:user) is needed.
Recommended modules/libraries
None required. Works out of the box with any Drupal 10/11 installation.