def commitCheck(self, authToken, nameVersionList):
        """ checks that we can commit to a list of (name, version) tuples """
        self.log(3, authToken[0], "entitlements=%s" % (authToken[2],), nameVersionList)
        checkDict = {}
        # nameVersionList can actually be an iterator, so we need to keep
        # a list of the trove names we're dealing with
        troveList = []
        # first check that we handle all the labels we're asked about
        for i, (n, v) in enumerate(nameVersionList):
            label = v.branch().label()
            if label.getHost() not in self.serverNameList:
                raise errors.RepositoryMismatch(self.serverNameList, label.getHost())
            l = checkDict.setdefault(label.asString(), set())
            troveList.append(n)
            l.add(i)
        # default to all failing
        retlist = [ False ] * len(troveList)
        if not authToken[0]:
            return retlist
        # check groupIds. this is the same as the self.check() function
        cu = self.db.cursor()
        try:
            groupIds = self.getAuthRoles(cu, authToken)
        except errors.InsufficientPermission:
            return retlist
        if not len(groupIds):
            return retlist
        # build the query statement for permissions check
        stmt = """
        select Items.item
        from Permissions join Items using (itemId)
        """
        where = ["Permissions.canWrite=1"]
        where.append("Permissions.userGroupId IN (%s)" %
                     ",".join("%d" % x for x in groupIds))
        if len(checkDict):
            where.append("""(
            Permissions.labelId = 0 OR
            Permissions.labelId in (select labelId from Labels where label=?)
            )""")
        stmt += "WHERE " + " AND ".join(where)
        # we need to test for each label separately in case we have
        # mutiple troves living of multiple lables with different
        # permission settings
        for label in checkDict.iterkeys():
            cu.execute(stmt, label)
            patterns = [ x[0] for x in cu ]
            for i in checkDict[label]:
                for pattern in patterns:
                    if self.checkTrove(pattern, troveList[i]):
                        retlist[i] = True
                        break
        return retlist

    # checks for group-wide permissions like admin and mirror
dataset/ETHPy150Open sassoftware/conary/conary/repository/netrepos/netauth.py/NetworkAuthorization.commitCheck/original