def check(self, authToken, write = False, label = None,
              trove = None, remove = False, allowAnonymous = True):
        self.log(3, authToken[0],
                 "entitlements=%s write=%s label=%s trove=%s remove=%s" %(
            authToken[2], int(bool(write)), label, trove, int(bool(remove))))

        if label and self.serverNameList not in label.getHost():
            raise errors.RepositoryMismatch(self.serverNameList, label.getHost())

        if not authToken[0]:
            return False

        cu = self.db.cursor()

        try:
            groupIds = self.getAuthRoles(cu, authToken,
                                         allowAnonymous = allowAnonymous)
        except errors.InsufficientPermission:
            return False

        if len(groupIds) < 1:
            return False
        elif not label and not trove and not remove and not write:
            # no more checks to do -- the authentication information is valid
            return True

        stmt = """
        select Items.item
        from Permissions join items using (itemId)
        """
        params = []
        where = []
        if len(groupIds):
            where.append("Permissions.userGroupId IN (%s)" %
                     ",".join("%d" % x for x in groupIds))
        if label:
            where.append("""
            (
            Permissions.labelId = 0 OR
            Permissions.labelId in
                ( select labelId from Labels where Labels.label = ? )
            )
            """)
            params.append(label.asString())

        if write:
            where.append("Permissions.canWrite=1")

        if remove:
            where.append("Permissions.canRemove=1")

        if where:
            stmt += "WHERE " + " AND ".join(where)

        self.log(4, stmt, params)
        cu.execute(stmt, params)

        for (pattern,) in cu:
            if self.checkTrove(pattern, trove):
                return True

        return False
dataset/ETHPy150Open sassoftware/conary/conary/repository/netrepos/netauth.py/NetworkAuthorization.check/swapped operands of `not in`