def batchCheck(self, authToken, troveList, write = False, cu = None):
        """ checks access permissions for a set of *existing* troves in the repository """
        # troveTupList is a list of (name, VFS) tuples
        self.log(3, authToken[0], "entitlements=%s write=%s" %(authToken[2], int(bool(write))),
                 troveList)
        # process/check the troveList, which can be an iterator
        checkList = []
        for i, (n,v,f) in enumerate(troveList):
            h = versions.VersionFromString(v).getHost()
            if h not in self.serverNameList:
                raise errors.RepositoryMismatch(self.serverNameList, h)
            checkList.append((i,n,v,f))
        # default to all failing
        retlist = [ False ] * len(checkList)
        if not authToken[0]:
            return retlist
        # check groupIds
        if cu is None:
            cu = self.db.cursor()
        try:
            groupIds = self.getAuthRoles(cu, authToken)
        except errors.InsufficientPermission:
            return retlist
        if not len(groupIds):
            return retlist
        resetTable(cu, "tmpNVF")
        self.db.bulkload("tmpNVF", checkList, ["idx","name","version", "flavor"],
                         start_transaction=False)
        self.db.analyze("tmpNVF")
        writeCheck = ''
        if write:
            writeCheck = "and ugi.canWrite = 1"
        cu.execute("""
        select t.idx, i.instanceId
        from tmpNVF as t
        join Items on t.name = Items.item
        join Versions on t.version = Versions.version
        join Flavors on t.flavor = Flavors.flavor
        join Instances as i on
            i.itemId = Items.itemId and
            i.versionId = Versions.versionId and
            i.flavorId = Flavors.flavorId
        join UserGroupInstancesCache as ugi on i.instanceId = ugi.instanceId
        where ugi.userGroupId in (%s)
        %s""" % (",".join("%d" % x for x in groupIds), writeCheck) )
        for i, instanceId in cu:
            retlist[i] = True
        return retlist
dataset/ETHPy150Open sassoftware/conary/conary/repository/netrepos/netauth.py/NetworkAuthorization.batchCheck/original