mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[aws|storage] Support ACL on copy_object. ✌️
This commit is contained in:
parent
1512fe6227
commit
f15bf2554a
1 changed files with 8 additions and 0 deletions
|
@ -51,6 +51,14 @@ module Fog
|
||||||
source_object = source_bucket && source_bucket[:objects][source_object_name]
|
source_object = source_bucket && source_bucket[:objects][source_object_name]
|
||||||
target_bucket = self.data[:buckets][target_bucket_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
|
if source_object && target_bucket
|
||||||
response.status = 200
|
response.status = 200
|
||||||
target_object = source_object.dup
|
target_object = source_object.dup
|
||||||
|
|
Loading…
Add table
Reference in a new issue