Skip to content

Commit

Permalink
Support clients and users fields in ACL PUT requests
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc Paradise committed Aug 23, 2016
1 parent 50db4d7 commit 5abd183
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion lib/chef_zero/chef_data/data_normalizer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,18 @@ class DataNormalizer
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
Expand Down
2 changes: 1 addition & 1 deletion lib/chef_zero/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module ChefZero
VERSION = "4.9.0"
VERSION = "4.9.1"
end

0 comments on commit 5abd183

Please sign in to comment.