Class: Kaui::EngineController

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

Instance Method Summary collapse

Instance Method Details

#current_abilityObject



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

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



19
20
21
# File 'app/controllers/kaui/engine_controller.rb', line 19

def current_user
  super
end

#options_for_klient(options = {}) ⇒ Object

Common options for the Kill Bill client



7
8
9
10
11
12
13
14
15
16
# File 'app/controllers/kaui/engine_controller.rb', line 7

def options_for_klient(options = {})
  {
      # TODO Kaui doesn't support multi-tenancy yet
      :api_key    => KillBillClient.api_key,
      :api_secret => KillBillClient.api_secret,
      :username   => current_user.kb_username || KillBillClient.username,
      :password   => current_user.password || KillBillClient.password,
      :session_id => current_user.kb_session_id
  }.merge(options)
end