Sha256: 6b81c7959312019f54ff934c23570e9739673a5ff666547b9b857b7c97032e6a

Contents?: true

Size: 791 Bytes

Versions: 7

Compression:

Stored size: 791 Bytes

Contents

module KPM
  class EngineController < ApplicationController

    layout :get_layout

    def get_layout
      layout ||= KPM.config[:layout]
    end

    def current_tenant_user
      # If the rails application on which that engine is mounted defines such method (Devise), we extract the current user,
      # if not we default to nil, and serve our static mock configuration
      user = current_user if respond_to?(:current_user)
      KPM.current_tenant_user.call(session, user)
    end

    def options_for_klient
      user = current_tenant_user
      {
          :username => user[:username],
          :password => user[:password],
          :session_id => user[:session_id],
          :api_key => user[:api_key],
          :api_secret => user[:api_secret]
      }
    end

  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
killbill-kpm-ui-1.0.2 app/controllers/kpm/engine_controller.rb
killbill-kpm-ui-1.0.1 app/controllers/kpm/engine_controller.rb
killbill-kpm-ui-1.0.0 app/controllers/kpm/engine_controller.rb
killbill-kpm-0.3.0 app/controllers/kpm/engine_controller.rb
killbill-kpm-0.2.0 app/controllers/kpm/engine_controller.rb
killbill-kpm-0.1.0 app/controllers/kpm/engine_controller.rb
killbill-kpm-0.0.1 app/controllers/kpm/engine_controller.rb