~djfroofy/txaws/930359-headers

« back to all changes in this revision

Viewing changes to txaws/s3/client.py

Added support for another S3 method: put_object_acl.

Reviewer: Thomas Herve
Fixes: https://bugs.launchpad.net/txaws/+bug/919433

Show diffs side-by-side

added added

removed removed

Lines of Context:
284
284
            bucket=bucket, object_name=object_name)
285
285
        return query.submit()
286
286
 
 
287
    def put_object_acl(self, bucket, object_name, access_control_policy):
 
288
        """
 
289
        Set access control policy on an object.
 
290
        """
 
291
        data = access_control_policy.to_xml()
 
292
        query = self.query_factory(
 
293
            action='PUT', creds=self.creds, endpoint=self.endpoint,
 
294
            bucket=bucket, object_name='%s?acl' % object_name, data=data)
 
295
        return query.submit().addCallback(self._parse_acl)
 
296
 
287
297
    def get_object_acl(self, bucket, object_name):
288
298
        """
289
299
        Get the access control policy for an object.