コード例 #1
0
ファイル: tests.py プロジェクト: Iliker/ks3-python-sdk
 def test_set_acl(self):
     owner = User(id='1234567890', display_name='test')
     acl = ACL()
     grant = Grant()
     grant.permission = "READ"
     grant.display_name = "test"
     grant.email_address = "*****@*****.**"
     acl.add_grant(grant)
     policy = Policy()
     policy.owner = owner
     policy.acl = acl
     bucket = conn.get_bucket(test_bucket)
     #ret = bucket.set_acl("public-read-write", test_key)
     ret = bucket.set_acl(policy, test_key)
     print(ret)
コード例 #2
0
ファイル: tests.py プロジェクト: LingLiGit/ks3-python-sdk
 def test_set_acl(self):
     owner = User(id='1234567890', display_name='test')
     acl = ACL()
     grant = Grant()
     grant.permission = "READ"
     grant.display_name = "test"
     grant.email_address = "*****@*****.**"
     acl.add_grant(grant)
     policy = Policy()
     policy.owner = owner
     policy.acl = acl
     bucket = conn.get_bucket(test_bucket)
     #ret = bucket.set_acl("public-read-write", test_key)
     ret = bucket.set_acl(policy, test_key)
     print ret
コード例 #3
0
ファイル: tests.py プロジェクト: pengsven/ks3-python-sdk
 def test_set_acl(self):
     owner = User(id='1234567890', display_name='test')
     acl = ACL()
     grant = Grant()
     grant.permission = "READ"
     grant.display_name = "test"
     grant.email_address = "*****@*****.**"
     grant.type = 'CanonicalUser'
     acl.add_grant(grant)
     policy = Policy()
     policy.owner = owner
     policy.acl = acl
     bucket = conn.get_bucket(test_bucket)
     # ret = bucket.set_acl("public-read-write", test_key)
     ret = bucket.set_xml_acl(policy.to_xml(),
                              test_key,
                              headers={'content-type': 'text/plain'})
     print(ret)