Skip to content

feat: full admin impersonation with actor audit attribution - #458

Merged
NaysKutzu merged 2 commits into
developfrom
feat/admin-impersonate-audit
Nov 6, 2026
Merged

NaysKutzu merged 2 commits into
developfrom
feat/admin-impersonate-audit

Conversation

@NaysKutzu

Copy link
Copy Markdown
Member

Summary

  • Upgrades admin "view as user" from read-only to write-capable impersonation (admin.users.impersonate), with a clear banner and Stop button.
  • Every mutating request and activity row is attributed as admin X as user Y via new actor_uuid on featherpanel_activity (migration included); audit log UI/CSV show the actor.
  • Blocks self-impersonation, nested impersonation, privilege escalation onto root staff, and account deletion while impersonating. Session-only (no API-key impersonation).

Test plan

  • As admin with admin.users.impersonate, open a user → Impersonate → land on dashboard with red banner
  • Perform a write as that user (e.g. update a preference) → audit log shows actor + "admin X as user Y"
  • Account deletion while impersonating returns IMPERSONATION_ACTION_BLOCKED and is audit logged
  • Cannot impersonate yourself; cannot start a second impersonation without stopping; non-root cannot impersonate staff/root
  • Stop impersonating returns to the user edit page; logout clears impersonation cookie

@coderabbitai

coderabbitai Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 2 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between caff192 and f1369b5.

Files selected for processing: 12

  • CHANGELOG.md
  • backend/app/Chat/Activity.php
  • backend/app/Controllers/Admin/AuditLogController.php
  • backend/app/Controllers/Admin/ImpersonationController.php
  • backend/app/Helpers/Impersonation.php
  • backend/app/Middleware/AuthMiddleware.php
  • backend/app/Runtime/RequestContext.php
  • backend/storage/migrations/2026-11-06.02.40-activity-actor-uuid.sql
  • frontendv2/public/locales/en.json
  • frontendv2/src/app/(app)/admin/audit-log/page.tsx
  • frontendv2/src/components/layout/ImpersonationBanner.tsx
  • permission_nodes.fpperm
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@NaysKutzu
NaysKutzu force-pushed the feat/admin-impersonate-audit branch from dba0331 to 93c6701 Compare November 6, 2026 01:47
Upgrade view-as from read-only to write-capable impersonation. Every
mutating request and activity row is attributed as admin X as user Y
via actor_uuid, with UI banner, easy exit, and blocks for self/nested
impersonation, root privilege escalation, and account deletion.
@NaysKutzu
NaysKutzu force-pushed the feat/admin-impersonate-audit branch from 93c6701 to dc102b0 Compare November 6, 2026 02:16
Keep both CHANGELOG entries (impersonation + AI editor helper).
@NaysKutzu
NaysKutzu merged commit 608fead into develop Nov 6, 2026
18 checks passed
@NaysKutzu
NaysKutzu deleted the feat/admin-impersonate-audit branch November 6, 2026 02:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant