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.5.0 config/effective_resources.rb
effective_resources-1.4.13 config/effective_resources.rb
effective_resources-1.4.12 config/effective_resources.rb
effective_resources-1.4.11 config/effective_resources.rb
effective_resources-1.4.10 config/effective_resources.rb
effective_resources-1.4.9 config/effective_resources.rb
effective_resources-1.4.8 config/effective_resources.rb
effective_resources-1.4.7 config/effective_resources.rb
effective_resources-1.4.6 config/effective_resources.rb
effective_resources-1.4.5 config/effective_resources.rb
effective_resources-1.4.4 config/effective_resources.rb
effective_resources-1.4.3 config/effective_resources.rb
effective_resources-1.4.2 config/effective_resources.rb
effective_resources-1.4.1 config/effective_resources.rb
effective_resources-1.4.0 config/effective_resources.rb
effective_resources-1.3.16 config/effective_resources.rb
effective_resources-1.3.15 config/effective_resources.rb
effective_resources-1.3.14 config/effective_resources.rb
effective_resources-1.3.13 config/effective_resources.rb
effective_resources-1.3.12 config/effective_resources.rb