summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-09-11 11:28:23 -0700
committerTim Smith <tsmith84@gmail.com>2020-09-11 17:15:46 -0700
commit3643b3254966efd9821fe398a4289f4c52592215 (patch)
treef0e9b8558d009022da7a47afae7cc15f024709dc /lib
parent405778e51c3ffde480b6d2e94ec56b7dde9232c5 (diff)
downloadchef-3643b3254966efd9821fe398a4289f4c52592215.tar.gz
Allow users to take a String as well
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'lib')
-rw-r--r--lib/chef/resource/windows_user_privilege.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/chef/resource/windows_user_privilege.rb b/lib/chef/resource/windows_user_privilege.rb
index 2814896fc3..639e27e987 100644
--- a/lib/chef/resource/windows_user_privilege.rb
+++ b/lib/chef/resource/windows_user_privilege.rb
@@ -129,13 +129,14 @@ class Chef
description: "An optional property to add the user to the given privilege. Use only with add and remove action.",
name_property: true
- property :users, Array,
- description: "An optional property to set the privilege for given users. Use only with set action."
+ property :users, [Array, String],
+ description: "An optional property to set the privilege for given users. Use only with set action.",
+ coerce: proc { |v| Array(v) }
property :privilege, [Array, String],
description: "One or more privileges to set for users.",
required: true,
- coerce: proc { |v| Array[v] },
+ coerce: proc { |v| Array(v) },
callbacks: {
"Option privilege must include any of the: #{PRIVILEGE_OPTS}" => lambda { |n| (n - PRIVILEGE_OPTS).empty? },
}