Sha256: a10e53c687d0353d0b51ec0ef72f6ea4b1a44205083905df08c9bd18323f0dd5

Contents?: true

Size: 1.39 KB

Versions: 107

Compression:

Stored size: 1.39 KB

Contents

EffectiveResources.setup do |config|
  # Authorization Method
  #
  # This method is called by all controller actions with the appropriate action and resource
  # If it raises an exception or returns false, an Effective::AccessDenied Error will be raised
  #
  # Use via Proc:
  # Proc.new { |controller, action, resource| authorize!(action, resource) }       # CanCan
  # Proc.new { |controller, action, resource| can?(action, resource) }             # CanCan with skip_authorization_check
  # Proc.new { |controller, action, resource| authorize "#{action}?", resource }   # Pundit
  # Proc.new { |controller, action, resource| current_user.is?(:admin) }           # Custom logic
  #
  # Use via Boolean:
  # config.authorization_method = true  # Always authorized
  # config.authorization_method = false # Always unauthorized
  #
  # Use via Method (probably in your application_controller.rb):
  # config.authorization_method = :my_authorization_method
  # def my_authorization_method(resource, action)
  #   true
  # end
  config.authorization_method = Proc.new { |controller, action, resource| authorize!(action, resource) }

  # These default submit actions will be added to each controller
  # and rendered when calling effective_submit(f)
  # based on the controller, and its `submits` if any.
  #
  # Supported values: 'Save', 'Continue', and 'Add New'
  config.default_submits = ['Save', 'Continue', 'Add New']

end

Version data entries

107 entries across 107 versions & 1 rubygems

Version Path
effective_resources-1.9.19 config/effective_resources.rb
effective_resources-1.9.18 config/effective_resources.rb
effective_resources-1.9.17 config/effective_resources.rb
effective_resources-1.9.16 config/effective_resources.rb
effective_resources-1.9.15 config/effective_resources.rb
effective_resources-1.9.14 config/effective_resources.rb
effective_resources-1.9.13 config/effective_resources.rb
effective_resources-1.9.12 config/effective_resources.rb
effective_resources-1.9.11 config/effective_resources.rb
effective_resources-1.9.10 config/effective_resources.rb
effective_resources-1.9.9 config/effective_resources.rb
effective_resources-1.9.8 config/effective_resources.rb
effective_resources-1.9.7 config/effective_resources.rb
effective_resources-1.9.6 config/effective_resources.rb
effective_resources-1.9.5 config/effective_resources.rb
effective_resources-1.9.4 config/effective_resources.rb
effective_resources-1.9.3 config/effective_resources.rb
effective_resources-1.9.2 config/effective_resources.rb
effective_resources-1.9.1 config/effective_resources.rb
effective_resources-1.9.0 config/effective_resources.rb