def test_set_bucket_acl(self): bucket = conn.get_bucket(test_bucket) p = Policy() acl = ACL() grant = Grant(id='test1', display_name='test1', type='CanonicalUser', permission='READ') acl.add_grant(grant) p.owner = User(id='1234567890', display_name='test') p.acl = acl bucket.set_acl(acl_or_str=p, headers={'content-type': 'text/plain'})
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)
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
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)
def test_set_bucket_acl(self): bucket = conn.get_bucket(test_bucket) p = Policy() p.acl = ACL() p.owner = User(id='1234567890', display_name='test') bucket.set_acl(policy)