189: def set_right(name, values)
190:
191:
192:
193: values = convert_plist_to_native_attributes(values)
194: tmp = Tempfile.new('puppet_macauthorization')
195: begin
196: Plist::Emit.save_plist(values, tmp.path)
197: cmds = []
198: cmds << :security << "authorizationdb" << "write" << name
199: output = execute(cmds, :combine => false,
200: :stdinfile => tmp.path.to_s)
201: rescue Errno::EACCES => e
202: raise Puppet::Error.new("Cannot save right to #{tmp.path}: #{e}")
203: ensure
204: tmp.close
205: tmp.unlink
206: end
207: end