diff options
author | Marc Paradise <marc@chef.io> | 2016-08-23 18:37:38 -0400 |
---|---|---|
committer | Marc Paradise <marc@chef.io> | 2016-08-23 19:12:55 -0400 |
commit | 6a05c3198785eb098786bfdcafd7a81c9c9682f3 (patch) | |
tree | 158fc3b700937ca6ea529cc1b5729e5d7a29ec4a | |
parent | 50db4d7be53df4bdf9b66da3c95914fc69068ce9 (diff) | |
download | chef-zero-6a05c3198785eb098786bfdcafd7a81c9c9682f3.tar.gz |
Support clients and users fields in ACL PUT requestsmp/SPOOL-197
-rw-r--r-- | lib/chef_zero/chef_data/data_normalizer.rb | 12 | ||||
-rw-r--r-- | lib/chef_zero/version.rb | 2 |
2 files changed, 12 insertions, 2 deletions
diff --git a/lib/chef_zero/chef_data/data_normalizer.rb b/lib/chef_zero/chef_data/data_normalizer.rb index a762581..0df7fe5 100644 --- a/lib/chef_zero/chef_data/data_normalizer.rb +++ b/lib/chef_zero/chef_data/data_normalizer.rb @@ -8,8 +8,18 @@ module ChefZero def self.normalize_acls(acls) ChefData::DefaultCreator::PERMISSIONS.each do |perm| acls[perm] ||= {} - (acls[perm]["actors"] ||= []).uniq! # this gets doubled sometimes, for reasons. acls[perm]["groups"] ||= [] + if acls[perm].has_key? "users" + # When clients and users are split, their combined list + # is the final list of actors that a subsequent GET will + # provide. Each list is guaranteed to be unique, but the + # combined list is not. + acls[perm]["actors"] = acls[perm].delete("users").uniq + + acls[perm].delete("clients").uniq + else + # this gets doubled sometimes, for reasons. + (acls[perm]["actors"] ||= []).uniq! + end end acls end diff --git a/lib/chef_zero/version.rb b/lib/chef_zero/version.rb index 07bd466..f91c989 100644 --- a/lib/chef_zero/version.rb +++ b/lib/chef_zero/version.rb @@ -1,3 +1,3 @@ module ChefZero - VERSION = "4.9.0" + VERSION = "4.9.1" end |