Module: Authorization::InstanceMethods

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/saasaparilla/authorization.rb', line 6

def self.included(base)
  if Saasaparilla::CONFIG["authorization"] == "cancan"
    base.rescue_from ::CanCan::AccessDenied do |exception|
      redirect_to '/'
      flash[:error] = exception.to_s
    end
    
    base.load_and_authorize_resource 
    
  end
    # Override this module an initializer with Authorization::InstanceMethods.module_eval and add your own authorization
   # base.before_filter :custom_method
end