Class: Chef::ChefFS::FileSystem::AclsDir
Constant Summary
collapse
- ENTITY_TYPES =
we don’t read sandboxes, so we don’t read their acls
%w(clients containers cookbooks data_bags environments groups nodes roles)
Instance Attribute Summary
Attributes inherited from BaseFSObject
#name, #parent, #path
Instance Method Summary
collapse
Methods inherited from BaseFSDir
#child, #dir?
#chef_object, #child, #compare_to, #create_child, #delete, #dir?, #exists?, #path_for_printing, #read, #root, #write
Constructor Details
#initialize(parent) ⇒ AclsDir
Returns a new instance of AclsDir.
31
32
33
|
# File 'lib/chef/chef_fs/file_system/acls_dir.rb', line 31
def initialize(parent)
super('acls', parent)
end
|
Instance Method Details
39
40
41
|
# File 'lib/chef/chef_fs/file_system/acls_dir.rb', line 39
def api_path
parent.api_path
end
|
#can_have_child?(name, is_dir) ⇒ Boolean
43
44
45
|
# File 'lib/chef/chef_fs/file_system/acls_dir.rb', line 43
def can_have_child?(name, is_dir)
is_dir ? ENTITY_TYPES.include(name) : name == 'organization.json'
end
|
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
# File 'lib/chef/chef_fs/file_system/acls_dir.rb', line 47
def children
if @children.nil?
@children = ENTITY_TYPES.map do |entity_type|
case entity_type
when 'cookbooks'
CookbooksAclDir.new(entity_type, self)
else
AclDir.new(entity_type, self)
end
end
@children << AclEntry.new('organization.json', self, true) end
@children
end
|
62
63
64
|
# File 'lib/chef/chef_fs/file_system/acls_dir.rb', line 62
def rest
parent.rest
end
|