Files
wekan/docs/Features/Admin-Panel/Problems/Impersonation-Report.md
T
Lauri Ojansivu 7e1f9e89eb Docs: every feature topic in one folder under docs/Features, each with README.md as its main page.
- The General/ level is gone: its 109 files moved up into the folders of the
  same name, and its topic table is the "Shared topics" section of
  Features.md.
- Accessibility is one folder, docs/Features/Accessibility/, with the Admin
  Panel's accessibility page in it.
- Every folder's main page is README.md (110 X/X.md pages renamed with git mv,
  five merged with an existing README.md, 26 index pages added for folders
  that had none), so a folder opened on GitHub shows its page.
- The 73 "# Moved" forwarding pages are deleted, with the folders that held
  only them; every link that went to one goes to its final page.
- docs/Features/README.md has the website's "Features in WeKan" overview,
  each feature linking to its page here.

1,129 Markdown links in 262 files and 352 doc paths in code, tests, compose,
snap and release files follow. tests/docsFeaturesLayout.test.cjs fails when
General/ or a "# Moved" page comes back, a folder has no README.md, or a
relative link in the docs or README.md does not resolve.

Thanks to xet7 !
2026-11-24 20:02:06 +02:00

5.8 KiB
Raw Blame History

Admin Panel / Problems / Impersonation Report

What it is

Every time an administrator acted as another user, and why. Impersonation lets an administrator see WeKan as one user sees it, for example to export a private board; this report is the audit trail of it, so that use of that power is visible afterwards. Address: /admin/problems/impersonation. Site administrators only: the publication sends nothing, and the count method refuses, for anybody who is not isAdmin.

Read more

How to use it

Impersonate a user (what makes a row)

  1. Open Admin Panel → People.
  2. On the user's row press ⋯ and choose Impersonate user.

Read the report

  1. Open Admin Panel → Problems → Impersonation Report.
  2. Read the table, newest first, 10 rows a page; use the previous/next page buttons for older rows.
  3. Click an Admin or Impersonated user name for the Edit user popup.
  4. Type in the search box and press Enter to search.

Nothing in this pane deletes or changes a row.

How the numbers are calculated

  • Rows per page: 10 (TABLE_PAGE_ROWS_PER_PAGE in models/lib/tablePage.js). The page is fetched from the server with limit = 10 and skip = (page - 1) × 10, sorted by createdAt descending.
  • Total: getImpersonationReportCount(searchTerm) counts every row that matches the search, and the page count is that total divided by 10, rounded up, and at least 1 (pageInfo in the same file). A page that no longer exists resolves to the last real page.
  • REST token reasons are kept up to 500 characters (reason.slice(0, 500) in server/models/users.js).

How it works in WeKan

The rows are the impersonatedUsers collection (models/impersonatedUsers.js). A row is written when:

Reason Written when
clickedImpersonate an administrator impersonates a user from Admin Panel / People (the impersonate method)
emergency: <note> an administrator ticked Emergency access before Impersonate in Admin Panel / People; the note says why, and every other administrator got an e-mail at that moment (models/lib/emergencyAccess.js)
restCreateToken: <reason> an administrator creates a login token for another user through the REST API; the reason is required and kept, up to 500 characters
exportJSON, exportJSONattachment, exportExcel, exportExcelCard, exportCardPDF, or the export type a board, card or attachment is exported while impersonating, with the board it was exported from

The export rows are written by models/export.js, models/exportExcel.js, models/exportExcelCard.js and models/exportPDF.js; the other two by server/models/users.js.

The table is the shared table page, fetched one page at a time from the server (server/publications/impersonationReport.js: the impersonationReport publication and the getImpersonationReportCount method). The publication publishes the page by hand (fetch, added, ready) rather than returning a live limited cursor, which would hang on FerretDB. It also publishes the referenced admin and user documents, never the current user, so the names can be shown and clicked:

Column Holds
Date when it happened
Admin the administrator; click the name for the Edit user popup
Impersonated user the user acted as, when there was one; click for Edit user
Board the board id, for exports
Reason one of the reasons above

The search box applies when Enter is pressed (client/components/settings/adminProblems.js). It matches, case-insensitively and literally (regex characters escaped), the admin, user, board and attachment ids and the reason (models/lib/impersonationReportQuery.js) - ids, not user names.

Tests: server/lib/tests/impersonationReportQuery.tests.js, tests/adminPageRows.test.cjs and the browser tests tests/playwright/specs/38-impersonation.e2e.js and tests/playwright/specs/admin-impersonation-avatar.e2e.js.

Commits