diff options
author | John Keiser <jkeiser@opscode.com> | 2014-08-21 14:47:17 -0700 |
---|---|---|
committer | John Keiser <jkeiser@opscode.com> | 2014-08-22 09:20:50 -0700 |
commit | c02c90532ddb6e7faa21b0642a200de2ec0f08d9 (patch) | |
tree | 57f4877e1bfea16a3809b8763fd1bc7a603c0b22 /lib/chef_zero/chef_data/default_creator.rb | |
parent | a4efe10a02590f9caa21544504a2b1d6f5ffb295 (diff) | |
download | chef-zero-c02c90532ddb6e7faa21b0642a200de2ec0f08d9.tar.gz |
Make /containers/organizations real
Diffstat (limited to 'lib/chef_zero/chef_data/default_creator.rb')
-rw-r--r-- | lib/chef_zero/chef_data/default_creator.rb | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/chef_zero/chef_data/default_creator.rb b/lib/chef_zero/chef_data/default_creator.rb index f0403ab..b649cf1 100644 --- a/lib/chef_zero/chef_data/default_creator.rb +++ b/lib/chef_zero/chef_data/default_creator.rb @@ -62,7 +62,7 @@ module ChefZero def get(path) return nil if deleted?(path) - case path[0] + result = case path[0] when 'acls' # /acls/* object_path = AclPath.get_object_path(path) @@ -89,6 +89,8 @@ module ChefZero end end end + + result end def list(path) @@ -101,13 +103,13 @@ module ChefZero case path[0] when 'acls' if path.size == 1 - [ 'root' ] + data.list(path + [ 'containers' ]) + [ 'root' ] + (data.list(path + [ 'containers' ]) - [ 'organizations' ]) else data.list(AclPath.get_object_path(path)) end when 'containers' - [ 'containers', 'users' ] + [ 'containers', 'users', 'organizations' ] when 'users' superusers @@ -256,7 +258,8 @@ module ChefZero def get_org_acl_default(path) object_path = AclPath.get_object_path(path) - return nil if !data_exists?(object_path) + # The actual things containers correspond to don't have to exist, as long as the container does + return nil if object_path[2] != 'containers' && !data_exists?(object_path) basic_acl = case path[3..-1].join('/') when 'root', 'containers/containers', 'containers/groups' |