diff options
author | Marc A. Paradise <marcparadise@users.noreply.github.com> | 2016-08-24 10:57:23 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-24 10:57:23 -0400 |
commit | e135cd4894444cdeb991880598ea3c4e50548f89 (patch) | |
tree | 3c87052167257d27104410eaf118bc505f79b96c | |
parent | 2cd2895f9c864ed72ffb4df2ecd5d1ae406a51b9 (diff) | |
parent | 6a05c3198785eb098786bfdcafd7a81c9c9682f3 (diff) | |
download | chef-zero-e135cd4894444cdeb991880598ea3c4e50548f89.tar.gz |
Merge pull request #239 from chef/mp/SPOOL-197
Support clients and users fields in ACL PUT requests
-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 |