Sha256: ef1a753a7df07fbb838d806cda1ddb12e91896b83babaaad92d2d6d7bd288e9d

Contents?: true

Size: 658 Bytes

Versions: 1

Compression:

Stored size: 658 Bytes

Contents

require 'simple_form'
require 'effective_resources'
require 'effective_datatables/engine'
require 'effective_datatables/version'

module EffectiveDatatables
  mattr_accessor :authorization_method

  mattr_accessor :default_length
  mattr_accessor :actions_column # A Hash
  mattr_accessor :google_chart_packages

  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

1 entries across 1 versions & 1 rubygems

Version Path
effective_datatables-3.0.7 lib/effective_datatables.rb