Class: Chef::ChefFS::FileSystem::ChefServer::AclsDir
- Inherits:
-
BaseFSDir
show all
- Defined in:
- lib/chef/chef_fs/file_system/chef_server/acls_dir.rb
Constant Summary
collapse
- ENTITY_TYPES =
we don’t read sandboxes, so we don’t read their acls
%w{clients containers cookbook_artifacts cookbooks data_bags environments groups nodes policies policy_groups roles}.freeze
Instance Attribute Summary
Attributes inherited from BaseFSObject
#name, #parent, #path
Instance Method Summary
collapse
Methods inherited from BaseFSDir
#dir?, #empty?, #initialize
#chef_object, #child, #compare_to, #create_child, #delete, #dir?, #exists?, #initialize, #path_for_printing, #read, #root, #write
Instance Method Details
#api_path ⇒ Object
37
38
39
|
# File 'lib/chef/chef_fs/file_system/chef_server/acls_dir.rb', line 37
def api_path
parent.api_path
end
|
#can_have_child?(name, is_dir) ⇒ Boolean
45
46
47
|
# File 'lib/chef/chef_fs/file_system/chef_server/acls_dir.rb', line 45
def can_have_child?(name, is_dir)
is_dir ? ENTITY_TYPES.include?(name) : name == "organization.json"
end
|
#children ⇒ Object
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
# File 'lib/chef/chef_fs/file_system/chef_server/acls_dir.rb', line 49
def children
if @children.nil?
@children = ENTITY_TYPES.map do |entity_type|
case entity_type
when "cookbooks", "cookbook_artifacts"
CookbooksAclDir.new(entity_type, self)
when "policies"
PoliciesAclDir.new(entity_type, self)
else
AclDir.new(entity_type, self)
end
end
@children << AclEntry.new("organization.json", self, true) end
@children
end
|
#make_child_entry(name) ⇒ Object
41
42
43
|
# File 'lib/chef/chef_fs/file_system/chef_server/acls_dir.rb', line 41
def make_child_entry(name)
children.find { |child| child.name == name }
end
|
#rest ⇒ Object
68
69
70
|
# File 'lib/chef/chef_fs/file_system/chef_server/acls_dir.rb', line 68
def rest
parent.rest
end
|