Sha256: 6b4d65b8222e46db8cc104b38912cf03664e02cb9f951e2918cf1436710de4f8

Contents?: true

Size: 614 Bytes

Versions: 5

Compression:

Stored size: 614 Bytes

Contents

module Authorization
  module ClassMethods
  
  end
  module InstanceMethods
    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
    

     # def custom_method
     
     # end
    
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
saasaparilla-0.2.2 lib/saasaparilla/authorization.rb
saasaparilla-0.2.1 lib/saasaparilla/authorization.rb
saasaparilla-0.1.8 lib/saasaparilla/authorization.rb
saasaparilla-0.1.7 lib/saasaparilla/authorization.rb
saasaparilla-0.1.6 lib/saasaparilla/authorization.rb