diff options
author | John Keiser <jkeiser@opscode.com> | 2014-07-24 20:00:28 -0600 |
---|---|---|
committer | John Keiser <jkeiser@opscode.com> | 2014-08-22 09:20:48 -0700 |
commit | c5a81a1d9c2d04c0c3997b1ff75ba231a1ab01d1 (patch) | |
tree | eb7e63a2274f664b9c9d9510e24975cec3dbdd27 /lib/chef_zero/data_store | |
parent | e3502878f663c927b847a83cd7391db6695ad3e8 (diff) | |
download | chef-zero-c5a81a1d9c2d04c0c3997b1ff75ba231a1ab01d1.tar.gz |
clients created w/org do not own themselves;
containers created w/org do not follow org rules
Diffstat (limited to 'lib/chef_zero/data_store')
-rw-r--r-- | lib/chef_zero/data_store/default_facade.rb | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/chef_zero/data_store/default_facade.rb b/lib/chef_zero/data_store/default_facade.rb index 7c8406a..6f69a82 100644 --- a/lib/chef_zero/data_store/default_facade.rb +++ b/lib/chef_zero/data_store/default_facade.rb @@ -243,11 +243,17 @@ module ChefZero end def self.owners_of(data, path) -# if is_created_with_org?(path, false) -# return owners_of(data, []) -# else - list_metadata(data, path, 'owners', :recurse_up) -# end + # The objects that were created with the org itself, and containers for + # some reason, have the peculiar property of missing pivotal from their acls. + if is_created_with_org?(path, false) || path[0] == 'organizations' && path[2] == 'containers' + list_metadata(data, path[0..1], 'owners') + else + result = list_metadata(data, path, 'owners', :recurse_up) + if path.size == 4 && path[0] == 'organizations' && path[2] == 'clients' + result |= [ path[3] ] + end + result + end end def self.org_defaults(name, creator, superusers, osc_compat) |