Class: Chef::ChefFS::FileSystem::ChefServer::CookbooksAclDir

Inherits:
AclDir show all
Defined in:
lib/chef/chef_fs/file_system/chef_server/cookbooks_acl_dir.rb

Instance Attribute Summary

Attributes inherited from BaseFSObject

#name, #parent, #path

Instance Method Summary collapse

Methods inherited from AclDir

#api_path, #can_have_child?, #create_child, #data_handler, #make_child_entry, #rest

Methods inherited from BaseFSDir

#can_have_child?, #dir?, #empty?, #initialize

Methods inherited from BaseFSObject

#can_have_child?, #chef_object, #child, #compare_to, #create_child, #delete, #dir?, #exists?, #initialize, #path_for_printing, #read, #root, #write

Constructor Details

This class inherits a constructor from Chef::ChefFS::FileSystem::BaseFSDir

Instance Method Details

#childrenObject

If versioned_cookbooks is on, the list of cookbooks will have versions in them. But all versions of a cookbook have the same acl, so even if we have cookbooks/apache2-1.0.0 and cookbooks/apache2-1.1.2, we will only have one acl: acls/cookbooks/apache2.json. Thus, the list of children of acls/cookbooks is a unique list of cookbook names.



31
32
33
34
35
36
37
# File 'lib/chef/chef_fs/file_system/chef_server/cookbooks_acl_dir.rb', line 31

def children
  if @children.nil?
    names = parent.parent.child(name).children.map { |child| "#{child.cookbook_name}.json" }
    @children = names.uniq.map { |name| make_child_entry(name, true) }
  end
  @children
end