Class: CommandTower::Me::AuditEventsController

Inherits:
ApplicationController show all
Includes:
Auth::AuthenticationBoundary, Auth::AuthorizationBoundary
Defined in:
app/controllers/command_tower/me/audit_events_controller.rb

Constant Summary

Constants inherited from ApplicationController

ApplicationController::AUTHENTICATION_EXPIRE_HEADER, ApplicationController::AUTHENTICATION_HEADER, ApplicationController::AUTHENTICATION_WITH_RESET

Instance Method Summary collapse

Methods inherited from ApplicationController

#authenticate_user!, #authenticate_user_without_email_verification!, #authorize_user!, #current_user, #safe_boolean

Instance Method Details

#filter_optionsObject



41
42
43
44
45
# File 'app/controllers/command_tower/me/audit_events_controller.rb', line 41

def filter_options
  render_application_result(
    CommandTower::Workflows::Audit::Events::FilterOptionsForUserWorkflow.call
  )
end

#indexObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'app/controllers/command_tower/me/audit_events_controller.rb', line 12

def index
  deserialized = CommandTower::Deserializers::Audit::Events::UserListDeserializer.call(params)
  return render_deserializer_errors unless deserialized.success?

  render_application_result(
    CommandTower::Workflows::Audit::Events::ListForUserWorkflow.call(
      user: current_user,
      limit: deserialized.input.limit,
      offset: deserialized.input.offset,
      actions: deserialized.input.actions,
      occurred_after: deserialized.input.occurred_after,
      occurred_before: deserialized.input.occurred_before,
      subject_types: deserialized.input.subject_types
    )
  )
end

#showObject



29
30
31
32
33
34
35
36
37
38
39
# File 'app/controllers/command_tower/me/audit_events_controller.rb', line 29

def show
  deserialized = CommandTower::Deserializers::Audit::Events::ShowDeserializer.call(params)
  return render_deserializer_errors unless deserialized.success?

  render_application_result(
    CommandTower::Workflows::Audit::Events::ShowForUserWorkflow.call(
      user: current_user,
      id: deserialized.input.id
    )
  )
end