Sha256: c788842cbedb70fcd67ac91e64c1c2a216be30332297c4d80f610e2cd554dae5

Contents?: true

Size: 857 Bytes

Versions: 9

Compression:

Stored size: 857 Bytes

Contents

EffectiveDatatables.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| authorize!(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| true } # All users can see every screen
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
effective_datatables-1.1.4 lib/generators/templates/effective_datatables.rb
effective_datatables-1.1.3 lib/generators/templates/effective_datatables.rb
effective_datatables-1.1.2 lib/generators/templates/effective_datatables.rb
effective_datatables-1.1.1 lib/generators/templates/effective_datatables.rb
effective_datatables-1.1.0 lib/generators/templates/effective_datatables.rb
effective_datatables-1.0.3 lib/generators/templates/effective_datatables.rb
effective_datatables-1.0.2 lib/generators/templates/effective_datatables.rb
effective_datatables-1.0.1 lib/generators/templates/effective_datatables.rb
effective_datatables-1.0.0 lib/generators/templates/effective_datatables.rb