Module: Authority::Controller

Extended by:
ActiveSupport::Concern
Defined in:
lib/authority/controller.rb

Overview

Gets included into the app’s controllers automatically by the railtie

Defined Under Namespace

Modules: ClassMethods Classes: MissingAction, MissingResource

Class Method Summary collapse

Class Method Details

.security_violation_callbackObject



7
8
9
10
11
12
13
# File 'lib/authority/controller.rb', line 7

def self.security_violation_callback
  Proc.new do |exception|
    # Through the magic of ActiveSupport's `Proc#bind`, `ActionController::Base#rescue_from`
    # can call this proc and make `self` the actual controller instance
    self.send(Authority.configuration.security_violation_handler, exception)
  end
end