This project is not covered by Drupal’s security advisory policy.
MU Role Masquerade lets authorized users temporarily act with a different set of roles while keeping their own user account (UID). It is built for safe permission, menu, and access troubleshooting on staging and production sites without switching to another user's account.
Why MU Role Masquerade?
Traditional masquerade modules switch your entire user identity to another account, which can muddy audit logs, expose another user's private state, or require creating temporary user accounts. MU Role Masquerade keeps your own UID and decorates your session account's roles on the request:
- No privilege escalation: You can only assume role sets whose permissions are a strict subset of your real permissions.
- Locked & admin roles excluded:
anonymous,authenticated, andadministratorare never offered as targets. - Accurate UID 1 testing: Even user 1 loses the
SuperUserAccessPolicyall-access bypass while masquerading, so you experience the assumed roles' actual permissions. - Full audit trail: Because your UID never changes, watchdog/dblog entries and entity authors still record your real account, and start/stop/logout transitions are logged to the
mu_role_masqueradechannel.
Key Features
- Multi-role selection: Assume one or more configurable roles at once.
- Direct role switching: Switch from one assumed role set to another without having to switch back first.
- Always-visible exit path: A sticky high-contrast top banner appears while masquerading—even if the assumed roles lack
access toolbar—and respects Drupal Toolbar, Core Navigation, and Gin displace offsets. - Toolbar & Navigation integration: Highlights an active-masquerade tray in Core Toolbar and adds Switch back to the account menu and Core Navigation user flyout.
- Destination-aware Switch back: Returning from the banner, toolbar, or account menu brings you right back to the page you were testing.
- Session-only & logout-safe: Masquerade state lives in the session and is automatically cleared on logout.
- Cache-aware: Includes a dedicated
mu_role_masqueradecache context and invalidates user/menu/local-task tags on switch.
Requirements & Compatibility
- Drupal
^10.3 || ^11 - Core
usermodule (required) - Optional: Core
toolbar, Corenavigation, Gin admin theme
Quick Start
- Enable MU Role Masquerade.
- Go to People → Permissions and grant Use role masquerade plus the per-role Masquerade as ROLE permissions.
- Open Masquerade as role from your account menu or
/admin/people/role-masquerade.
Project information
Minimally maintained
Maintainers monitor issues, but fast responses are not guaranteed.Maintenance fixes only
Considered feature-complete by its maintainers.- Project categories: Access control, Administration tools, Developer tools
- Created by lethalkale on , updated
This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.
Releases
Initial stable release of MU Role Masquerade for Drupal 10.3+ and Drupal 11.





