Module: CommandTower::Impersonation::ClearOverlayForAudit

Defined in:
lib/command_tower/impersonation/clear_overlay_for_audit.rb

Overview

Temporarily clear overlay identity so impersonation_ended audits attribute as admin_direct to the actor. Lives outside workflows/services so leaf layers do not establish Current execution boundaries themselves.

Class Method Summary collapse

Class Method Details

.call(actor_user_id:) ⇒ Object



11
12
13
14
15
16
17
18
19
20
# File 'lib/command_tower/impersonation/clear_overlay_for_audit.rb', line 11

def call(actor_user_id:)
  CommandTower::Current.set(
    user_id: actor_user_id,
    effective_user_id: actor_user_id,
    originating_administrator_id: nil,
    impersonation_active: false
  ) do
    yield
  end
end