Sha256: dc483807dc8f539b2661876f7ae33356c7f26bee9a8bc142ebeb91571fc948fc

Contents?: true

Size: 671 Bytes

Versions: 3

Compression:

Stored size: 671 Bytes

Contents

module Authz
  # Inherits from the host app's ApplicationController so that all of it's methods
  # are available for the engine.
  #
  # All engine's controllers inherit from this class.
  # @api private
  class ApplicationController < ::ApplicationController
    include Authz::Controllers::AuthorizationManager

    protect_from_forgery with: :exception
    before_action :authenticate_authz_user
    before_action { authorize skip_scoping: true }
    around_action :verify_authorized

    private
    # Calls the authentication method configured by the main application
    def authenticate_authz_user
      send(Authz.force_authentication_method)
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
authz-0.0.5 app/controllers/authz/application_controller.rb
authz-0.0.4 app/controllers/authz/application_controller.rb
authz-0.0.3 app/controllers/authz/application_controller.rb