Method: Doorman::ClassMethods#_add_acl

Defined in:
lib/doorman.rb

#_add_acl(type, args, block) ⇒ Object



53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/doorman.rb', line 53

def _add_acl(type, args, block)
  opts = args.is_a?(Array) ? args.first : args
  if opts == :all
    @_doorman_default = type
    return true
  end
  if block
    _doorman_list << Rule.from_block(type, opts, &block)
  else
    _doorman_list << Rule.from_hash(type, opts)
  end
end