MU Masquerade by Role banner
MU Masquerade by Role logo
MU Masquerade by Role: (role) selection form
MU Masquerade by Role: Active Status
MU Masquerade by Role: Permissions

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, and administrator are never offered as targets.
  • Accurate UID 1 testing: Even user 1 loses the SuperUserAccessPolicy all-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_masquerade channel.

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_masquerade cache context and invalidates user/menu/local-task tags on switch.

Requirements & Compatibility

  • Drupal ^10.3 || ^11
  • Core user module (required)
  • Optional: Core toolbar, Core navigation, Gin admin theme

Quick Start

  1. Enable MU Role Masquerade.
  2. Go to People → Permissions and grant Use role masquerade plus the per-role Masquerade as ROLE permissions.
  3. Open Masquerade as role from your account menu or /admin/people/role-masquerade.

Project information

  • caution Minimally maintained
    Maintainers monitor issues, but fast responses are not guaranteed.
  • caution Maintenance fixes only
    Considered feature-complete by its maintainers.
  • Project categories: Access control, Administration tools, Developer tools
  • Created by lethalkale on , updated
  • shield alertThis project is not covered by the security advisory policy.
    Use at your own risk! It may have publicly disclosed vulnerabilities.

Releases