Sha256: cf040ab9dced4acaf73b389f301ab7cb377c5ae91fa681226eee6e2e10748324

Contents?: true

Size: 720 Bytes

Versions: 6

Compression:

Stored size: 720 Bytes

Contents

require 'haml-rails'
require 'kaminari'
require 'simple_form'
require 'effective_datatables/engine'

module EffectiveDatatables
  mattr_accessor :authorization_method
  mattr_accessor :date_format
  mattr_accessor :datetime_format
  mattr_accessor :integer_format
  mattr_accessor :boolean_format

  mattr_accessor :default_entries
  mattr_accessor :actions_column # A Hash

  def self.setup
    yield self
  end

  def self.authorized?(controller, action, resource)
    if authorization_method.respond_to?(:call) || authorization_method.kind_of?(Symbol)
      raise Effective::AccessDenied.new() unless (controller || self).instance_exec(controller, action, resource, &authorization_method)
    end
    true
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
effective_datatables-2.2.0 lib/effective_datatables.rb
effective_datatables-2.1.20 lib/effective_datatables.rb
effective_datatables-2.1.19 lib/effective_datatables.rb
effective_datatables-2.1.18 lib/effective_datatables.rb
effective_datatables-2.1.16 lib/effective_datatables.rb
effective_datatables-2.1.15 lib/effective_datatables.rb