MCPcopy Create free account
hub / github.com/s3tools/s3cmd / set_acl

Method set_acl

S3/S3.py:1144–1159  ·  view source on GitHub ↗
(self, uri, acl)

Source from the content-addressed store, hash-verified

1142 return acl
1143
1144 def set_acl(self, uri, acl):
1145 body = u"%s"% acl
1146 debug(u"set_acl(%s): acl-xml: %s" % (uri, body))
1147
1148 headers = SortedDict({'content-type': 'application/xml'}, ignore_case = True)
1149 if uri.has_object():
1150 request = self.create_request("OBJECT_PUT", uri = uri,
1151 headers = headers, body = body,
1152 uri_params = {'acl': None})
1153 else:
1154 request = self.create_request("BUCKET_CREATE", bucket = uri.bucket(),
1155 headers = headers, body = body,
1156 uri_params = {'acl': None})
1157
1158 response = self.send_request(request)
1159 return response
1160
1161 def set_versioning(self, uri, enabled):
1162 headers = SortedDict(ignore_case = True)

Callers 2

object_copyMethod · 0.95
set_accesslog_aclMethod · 0.95

Calls 5

create_requestMethod · 0.95
send_requestMethod · 0.95
SortedDictClass · 0.90
has_objectMethod · 0.80
bucketMethod · 0.80

Tested by

no test coverage detected