def testAclChangeWithAllUsers(self): change = acl_helper.AclChange('AllUsers:WRITE', scope_type=acl_helper.ChangeType.GROUP) acl = list( AclTranslation.BotoBucketAclToMessage(self.sample_uri.get_acl())) change.Execute(self.sample_url, acl, 'acl', self.logger) self._AssertHas(acl, 'WRITER', 'AllUsers')
def testAclChangeWithProjectOwners(self): change = acl_helper.AclChange(self._project_test_acl + ':READ', scope_type=acl_helper.ChangeType.PROJECT) acl = list( AclTranslation.BotoBucketAclToMessage(self.sample_uri.get_acl())) change.Execute(self.sample_url, acl, 'acl', self.logger) self._AssertHas(acl, 'READER', 'Project', self._project_test_acl)
def testAclChangeWithDomain(self): change = acl_helper.AclChange(self.DOMAIN_TEST + ':READ', scope_type=acl_helper.ChangeType.GROUP) acl = list( AclTranslation.BotoBucketAclToMessage(self.sample_uri.get_acl())) change.Execute(self.sample_url, acl, 'acl', self.logger) self._AssertHas(acl, 'READER', 'GroupByDomain', self.DOMAIN_TEST)
def testAclChangeWithGroupEmail(self): change = acl_helper.AclChange(self.GROUP_TEST_ADDRESS + ':fc', scope_type=acl_helper.ChangeType.GROUP) acl = list( AclTranslation.BotoBucketAclToMessage(self.sample_uri.get_acl())) change.Execute(self.sample_url, acl, 'acl', self.logger) self._AssertHas(acl, 'OWNER', 'GroupByEmail', self.GROUP_TEST_ADDRESS)
def testAclChangeWithUserEmail(self): change = acl_helper.AclChange(self.USER_TEST_ADDRESS + ':r', scope_type=acl_helper.ChangeType.USER) acl = list( AclTranslation.BotoBucketAclToMessage(self.sample_uri.get_acl())) change.Execute(self.sample_url, acl, 'acl', self.logger) self._AssertHas(acl, 'READER', 'UserByEmail', self.USER_TEST_ADDRESS)
def testAclChangeWithGroupId(self): change = acl_helper.AclChange(self.GROUP_TEST_ID + ':r', scope_type=acl_helper.ChangeType.GROUP) acl = list( AclTranslation.BotoBucketAclToMessage(self.sample_uri.get_acl())) change.Execute(self.sample_url, acl, 'acl', self.logger) self._AssertHas(acl, 'READER', 'GroupById', self.GROUP_TEST_ID)
def testAclChangeWithAllAuthUsers(self): change = acl_helper.AclChange('AllAuthenticatedUsers:READ', scope_type=acl_helper.ChangeType.GROUP) acl = list( AclTranslation.BotoBucketAclToMessage(self.sample_uri.get_acl())) change.Execute(self.sample_url, acl, 'acl', self.logger) self._AssertHas(acl, 'READER', 'AllAuthenticatedUsers') remove = acl_helper.AclDel('AllAuthenticatedUsers') remove.Execute(self.sample_url, acl, 'acl', self.logger) self._AssertHasNo(acl, 'READER', 'AllAuthenticatedUsers')
def testAclDelWithGroup(self): add = acl_helper.AclChange(self.USER_TEST_ADDRESS + ':READ', scope_type=acl_helper.ChangeType.GROUP) acl = list( AclTranslation.BotoBucketAclToMessage(self.sample_uri.get_acl())) add.Execute(self.sample_url, acl, 'acl', self.logger) self._AssertHas(acl, 'READER', 'GroupByEmail', self.USER_TEST_ADDRESS) remove = acl_helper.AclDel(self.USER_TEST_ADDRESS) remove.Execute(self.sample_url, acl, 'acl', self.logger) self._AssertHasNo(acl, 'READER', 'GroupByEmail', self.GROUP_TEST_ADDRESS)