Class: Chef::ChefFS::FileSystem::ChefServer::PoliciesAclDir

Inherits:
AclDir show all
Defined in:
lib/chef/chef_fs/file_system/chef_server/policies_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

Policies are presented like /NAME-VERSION.json. But there is only one ACL for a given NAME. So we find out the unique policy names, and make one acls/policies/NAME.json for each one.



29
30
31
32
33
34
35
36
# File 'lib/chef/chef_fs/file_system/chef_server/policies_acl_dir.rb', line 29

def children
  if @children.nil?
    # /acls/policies -> List ../../policies
    names = parent.parent.child(name).children.map { |child| "#{child.policy_name}.json" }
    @children = names.uniq.map { |name| make_child_entry(name, true) }
  end
  @children
end