Skip to content

How it behaves

For example, an editor switches off Editor on Monday, logs out at night without thinking about it, and logs in on Tuesday from another computer. With the default settings, all of their roles are back on: logging out on purpose forgets the choice. If their session had simply expired instead, Editor would still be off on Tuesday.

The choice

  • Nothing changes until the user chooses. Granting a toggle permission takes no role away. The user keeps all of their roles until they switch some off.
  • The form has one checkbox per role the user holds, and three buttons: Apply, All roles and Anonymous, the last one for users who may switch off every role they hold. Roles the user may not toggle are shown ticked and disabled.
  • Only ever fewer permissions. Switching roles can only take permissions away. A user never gets a role they do not hold.
  • A role granted later is on. The module remembers the roles switched off, not the ones left on, so a role the user receives afterwards is on.

How long it lasts

  • The session. The choice applies to every request of the session.
  • The next login. It also comes back at the next login, on any device, even after the session expired. It is kept per account, so several accounts used in one browser, for example with Masquerade, each keep their own.
  • Logging out. Logging out on purpose switches every role back on, unless the setting says otherwise. A session that expires keeps the choice.

The anonymous view

Anonymous shows the site as a visitor who is not logged in would see it. It lasts for the rest of the session only: the next login brings back the roles chosen before it. The block stays visible in the anonymous view, as the way back.

The anonymous view switches every role off, so only users who may switch off each of their roles get the button. A user holding a Restricted role without the Toggle own restricted roles permission does not.

User 1

While core's super user access policy is on, which is the default, user 1 holds every permission whatever their roles. Switching a role off would change nothing, so the module leaves user 1 alone. To preview the site, use another account.