示例#1
0
 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')
示例#2
0
 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)
示例#3
0
 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)
示例#4
0
 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)
示例#5
0
 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)
示例#6
0
 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)
示例#7
0
 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')
示例#8
0
    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)