Sha256: 3e4dbbb0e0d80fcf443646320977078e811db5cb774d997b50f7bab4ead3f7d7
Contents?: true
Size: 1.88 KB
Versions: 6
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_later # 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
6 entries across 6 versions & 1 rubygems