Permalink
Browse files

Add explicit support for canned-acl policy to Multipart Uploads.

- policy is a canned-acl policy similar to key.set_contents_*() apis.
  • Loading branch information...
1 parent bdddbbd commit c283da95f42f46e302887e3b09a0eaef859e4773 Thomas O'Dowd committed Apr 9, 2012
Showing with 9 additions and 3 deletions.
  1. +9 −3 boto/s3/bucket.py
View
12 boto/s3/bucket.py
@@ -1334,7 +1334,8 @@ def delete_policy(self, headers=None):
def initiate_multipart_upload(self, key_name, headers=None,
reduced_redundancy=False,
- metadata=None, encrypt_key=False):
+ metadata=None, encrypt_key=False,
+ policy=None):
"""
Start a multipart upload operation.
@@ -1365,11 +1366,16 @@ def initiate_multipart_upload(self, key_name, headers=None,
be encrypted on the server-side by S3 and
will be stored in an encrypted form while
at rest in S3.
+
+ :type policy: :class:`boto.s3.acl.CannedACLStrings`
+ :param policy: A canned ACL policy that will be applied to the
+ new key (once completed) in S3.
"""
query_args = 'uploads'
provider = self.connection.provider
- if headers is None:
- headers = {}
+ headers = headers or {}
+ if policy:
+ headers[provider.acl_header] = policy
if reduced_redundancy:
storage_class_header = provider.storage_class_header
if storage_class_header:

0 comments on commit c283da9

Please sign in to comment.