Sha256: 309c1651340355ac1bd75e5993be49905f84522a3ca8232d1dc77eb8e24b7b9d

Contents?: true

Size: 852 Bytes

Versions: 44

Compression:

Stored size: 852 Bytes

Contents

EffectiveResources.setup do |config|
  # Authorization Method
  #
  # This method is called by all controller actions with the appropriate action and resource
  # If the method returns false, an Effective::AccessDenied Error will be raised (see README.md for complete info)
  #
  # Use via Proc (and with CanCan):
  # config.authorization_method = Proc.new { |controller, action, resource| can?(action, resource) }
  #
  # Use via custom method:
  # config.authorization_method = :my_authorization_method
  #
  # And then in your application_controller.rb:
  #
  # def my_authorization_method(action, resource)
  #   current_user.is?(:admin)
  # end
  #
  # Or disable the check completely:
  # config.authorization_method = false
  config.authorization_method = Proc.new { |controller, action, resource| authorize!(action, resource) } # CanCanCan
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
effective_resources-0.4.2 config/effective_resources.rb
effective_resources-0.4.1 config/effective_resources.rb
effective_resources-0.4.0 config/effective_resources.rb
effective_resources-0.3.13 config/effective_resources.rb
effective_resources-0.3.12 config/effective_resources.rb
effective_resources-0.3.11 config/effective_resources.rb
effective_resources-0.3.10 config/effective_resources.rb
effective_resources-0.3.9 config/effective_resources.rb
effective_resources-0.3.8 config/effective_resources.rb
effective_resources-0.3.7 config/effective_resources.rb
effective_resources-0.3.6 config/effective_resources.rb
effective_resources-0.3.5 config/effective_resources.rb
effective_resources-0.3.4 config/effective_resources.rb
effective_resources-0.3.3 config/effective_resources.rb
effective_resources-0.3.2 config/effective_resources.rb
effective_resources-0.3.1 config/effective_resources.rb
effective_resources-0.3.0 config/effective_resources.rb
effective_resources-0.2.4 config/effective_resources.rb
effective_resources-0.2.3 config/effective_resources.rb
effective_resources-0.2.2 config/effective_resources.rb