Class: Chef::Resource::ChefAcl

Inherits:
Cheffish::BaseResource show all
Defined in:
lib/chef/resource/chef_acl.rb

Constant Summary

Constants included from Cheffish::BaseProperties

Cheffish::BaseProperties::ArrayType

Instance Method Summary collapse

Methods included from Cheffish::BaseProperties

#initialize

Instance Method Details

#remove_rights(*values) ⇒ Object

remove_rights :read, :users => ‘jkeiser’, :groups => [ ‘admins’, ‘users’ ] remove_rights [ :create, :read ], :users => [ ‘jkeiser’, ‘adam’ ] remove_rights :all, :users => [ ‘jkeiser’, ‘adam’ ]



44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/chef/resource/chef_acl.rb', line 44

def remove_rights(*values)
  if values.size == 0
    @remove_rights
  else
    args = values.pop
    args[:permissions] ||= []
    values.each do |value|
      args[:permissions] |= Array(value)
    end
    @remove_rights ||= []
    @remove_rights << args
  end
end

#rights(*values) ⇒ Object

rights :read, :users => ‘jkeiser’, :groups => [ ‘admins’, ‘users’ ] rights [ :create, :read ], :users => [ ‘jkeiser’, ‘adam’ ] rights :all, :users => ‘jkeiser’



27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/chef/resource/chef_acl.rb', line 27

def rights(*values)
  if values.size == 0
    @rights
  else
    args = values.pop
    args[:permissions] ||= []
    values.each do |value|
      args[:permissions] |= Array(value)
    end
    @rights ||= []
    @rights << args
  end
end