Class: Booth::Adminland::Incognitos::Start

Inherits:
Object
  • Object
show all
Includes:
Logging, Calls
Defined in:
lib/booth/adminland/incognitos/start.rb

Overview

The admin (impersonator) specifies their own scope and a target_scope. request is coerced with the impersonator's scope (+request.authentication+ checks the impersonator's scope). We create a new session for the target credential and store the impersonator's credential_id as incognito_credential_id. If target_scope matches the impersonator's scope, we revoke the impersonator's session before logging in as the target.

Instance Method Summary collapse

Instance Method Details

#callObject



20
21
22
23
24
25
26
27
28
# File 'lib/booth/adminland/incognitos/start.rb', line 20

def call
  do_check_impersonator_logged_in
    .on_success { do_find_target_credential }
    .on_success { do_compare_domain }
    .on_success { do_compare_scope }
    .on_success { do_create_session }
    .on_success { do_revoke_impersonator_if_same_scope }
    .on_success {  }
end