Class: Kaui::EngineController

Inherits:
ApplicationController
  • Object
show all
Includes:
EngineControllerUtil
Defined in:
app/controllers/kaui/engine_controller.rb

Instance Method Summary collapse

Instance Method Details

#check_for_redirect_to_tenant_screenObject



27
28
29
30
31
32
33
# File 'app/controllers/kaui/engine_controller.rb', line 27

def check_for_redirect_to_tenant_screen
  if !Kaui.is_user_assigned_valid_tenant?(current_user, session)
    flash[:error] = "No tenants configured for users AND KillBillClient.api_key, KillBillClient.api_secret have not been set"
    session[:kb_tenant_id] = nil
    redirect_to Kaui.tenant_home_path.call and return
  end
end

#current_abilityObject



22
23
24
25
# File 'app/controllers/kaui/engine_controller.rb', line 22

def current_ability
  # Redefined here to namespace Ability in the correct module
  @current_ability ||= Kaui::Ability.new(current_user)
end

#current_userObject

Used for auditing purposes



17
18
19
# File 'app/controllers/kaui/engine_controller.rb', line 17

def current_user
  super
end

#options_for_klient(options = {}) ⇒ Object

Common options for the Kill Bill client



10
11
12
13
14
# File 'app/controllers/kaui/engine_controller.rb', line 10

def options_for_klient(options = {})
  user_tenant_options = Kaui.current_tenant_user_options(current_user, session)
  user_tenant_options.merge(options)
  user_tenant_options
end