Class: CommandTower::Admin::Users::ImpersonationSessionsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/command_tower/admin/users/impersonation_sessions_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



7
8
9
10
11
12
13
14
15
16
17
18
# File 'app/controllers/command_tower/admin/users/impersonation_sessions_controller.rb', line 7

def create
  deserialized = CommandTower::Deserializers::Admin::Users::ShowDeserializer.call(params)
  return render_deserializer_errors unless deserialized.success?

  render_application_result(
    CommandTower::Workflows::Impersonation::StartWorkflow.call(
      id: deserialized.input.id,
      actor: current_user,
      scope_value: deserialized.input.scope_value
    )
  )
end