Impersonate for Omeka S
Impersonate lets trusted staff sign in as another user to reproduce issues or provide support, then return to their own account safely.
What it does
- Adds a quick “switch to” link next to usernames on Admin → Users (and an icon in row actions).
- Supports a GET shortcut on any admin URL: append
?login_as=<userId>
. - Shows a sticky banner at the very top with a “Return to admin” link.
- Blocks self‑impersonation and only allows switching to strictly lower roles.
- Settings: choose the minimum role that can impersonate (default: Global Administrator).
Install
- Copy to
omeka-s/modules/Impersonate
(directory name must beImpersonate
). - In Omeka S, go to Modules → Impersonate → Install.
Settings
- Minimum role that can impersonate: users with this role or higher can impersonate lower roles.
Usage
- From Admin → Users, click “· switch to” next to a user (non‑admin roles only).
- Or use
/admin/anything?login_as=<id>
to switch directly. - A banner appears at the very top; click “Return to admin” to revert.
Permissions & compatibility
- Registers resource
impersonate
with privilegemanage_impersonation
. - Default allowed role:
global_admin
(configurable via Settings above).
Local Development with Docker
This repository includes a Makefile and a docker-compose.yml
for quick local development using erseco/alpine-omeka-s.
Quick start
make up
Then open http://localhost:8080.
Preconfigured users
The environment automatically creates several users with different roles:
Role | Password | |
---|---|---|
admin@example.com | global_admin | PLEASE_CHANGEME |
siteadmin@example.com | site_admin | 1234 |
editor@example.com | editor | 1234 |
author@example.com | author | 1234 |
reviewer@example.com | reviewer | 1234 |
researcher@example.com | researcher | 1234 |
The Impersonate module is automatically enabled, so you can start testing right away.
Useful Make commands
make up
– Start Docker containers in interactive modemake upd
– Start in detached mode (background)make down
– Stop and remove containersmake shell
– Open a shell inside the Omeka S containermake lint
– Run PHP_CodeSniffermake fix
– Auto-fix coding style issuesmake package VERSION=1.2.3
– Build a.zip
release of the modulemake test
– Run PHPUnit tests
Run make help
for a full list.