Sha256: 737a9b1b8830116364b06939eecf6cb1a1ed83d685986890c41a3750cab62296

Contents?: true

Size: 1.88 KB

Versions: 2

Compression:

Stored size: 1.88 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) }

  # Default Submits
  #
  # 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']

  # Email Settings
  #
  # The default mailer settings for all effective gems
  #
  # Configure the parent class responsible to send e-mails.
  # config.parent_mailer = '::ApplicationMailer'

  # Default deliver method
  # config.deliver_method = :deliver_now

  # Default layout
  # config.mailer_layout = 'effective_mailer_layout'

  # Default From
  config.mailer_sender = "no-reply@example.com"

  # Send Admin correspondence To
  config.mailer_admin = "admin@example.com"
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
effective_resources-1.10.1 config/effective_resources.rb
effective_resources-1.10.0 config/effective_resources.rb