From f15bf2554a5183b9095ec1edf53cc79335eab197 Mon Sep 17 00:00:00 2001 From: Dylan Egan Date: Sun, 27 Nov 2011 15:40:40 -0800 Subject: [PATCH] [aws|storage] Support ACL on copy_object. :v: --- lib/fog/aws/requests/storage/copy_object.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/fog/aws/requests/storage/copy_object.rb b/lib/fog/aws/requests/storage/copy_object.rb index ec510cfa6..983b6632f 100644 --- a/lib/fog/aws/requests/storage/copy_object.rb +++ b/lib/fog/aws/requests/storage/copy_object.rb @@ -51,6 +51,14 @@ module Fog source_object = source_bucket && source_bucket[:objects][source_object_name] target_bucket = self.data[:buckets][target_bucket_name] + acl = options['x-amz-acl'] || 'private' + if !['private', 'public-read', 'public-read-write', 'authenticated-read'].include?(acl) + raise Excon::Errors::BadRequest.new('invalid x-amz-acl') + else + self.data[:acls][:object][target_bucket_name] ||= {} + self.data[:acls][:object][target_bucket_name][target_object_name] = self.class.acls(acl) + end + if source_object && target_bucket response.status = 200 target_object = source_object.dup