Skip to content

Impersonation start/stop audit events not appearing on the group-level page

Problem to solve

Audit Events for "impersonation start/stop" are not appearing in the group-level Audit Events page. Although the impersonation actions are appearing, it would be helpful to show the start/stop as well.

Proposal

Audit Events for beginning and ending an impersonation session should appear in the group-level audit log when the impersonated user belongs to a group (in addition to the instance-level audit log as they do already).

image

In this table, that is represented by the top three rows.

Proposal note

This is about showing instance-level AuditEvents in the group-level Audit log, which is closely related to showing project-level AuditEvents in the group-level Audit log.

Implementation plan

backend weight 3️⃣

  1. Update ImpersonationAuditEventService to accept an optional entity.
  2. Create a service to create an ImpersonationEvent for each user.groups in batches as a background job.
  3. Create a Started Impersonation in users_controller.rb using the new service.
  4. Create a Stopped Impersonation in application_controller.rb using the new service.
  5. Update audit events docs.
  6. Update specs.
Edited by Dan Jensen