summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThom May <thom@chef.io>2016-08-01 18:25:54 +0100
committerThom May <thom@chef.io>2016-08-01 18:35:19 +0100
commit9b48a9c38489bc624e1f9235c48994cc5d63173e (patch)
tree6c990033afd05f90dfa6ebae7bfe54289e384273
parent6b88d8c1bd89f9864478fc873352c2881441dbfe (diff)
downloadchef-tm/fix_acl_files.tar.gz
Root ACLs are a top level json file not a sub-directorytm/fix_acl_files
Ensure that we correctly write to them and manage them. Signed-off-by: Thom May <thom@chef.io>
-rw-r--r--lib/chef/chef_fs/file_system/repository/acls_dir.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/chef/chef_fs/file_system/repository/acls_dir.rb b/lib/chef/chef_fs/file_system/repository/acls_dir.rb
index 619031aa70..110befdf22 100644
--- a/lib/chef/chef_fs/file_system/repository/acls_dir.rb
+++ b/lib/chef/chef_fs/file_system/repository/acls_dir.rb
@@ -28,14 +28,16 @@ class Chef
module Repository
class AclsDir < Repository::Directory
+ BARE_FILES = %w{ organization.json root }
+
def can_have_child?(name, is_dir)
- is_dir ? Chef::ChefFS::FileSystem::ChefServer::AclsDir::ENTITY_TYPES.include?(name) : name == "organization.json"
+ is_dir ? Chef::ChefFS::FileSystem::ChefServer::AclsDir::ENTITY_TYPES.include?(name) : BARE_FILES.include?(name)
end
protected
def make_child_entry(child_name)
- if child_name == "organization.json"
+ if BARE_FILES.include? child_name
Acl.new(child_name, self)
else
AclsSubDir.new(child_name, self)