def checkUserExists(self):
        sql = "SELECT lower(username) as username FROM public.postnas_search_access_control WHERE lower(username) = :username"

        self.__openDB()
        queryCheckUserExists = QSqlQuery(self.db)
        if (self.dbSchema.lower() != "public"):
            sql = sql.replace("public.", self.dbSchema + ".")
        queryCheckUserExists.prepare(sql)
        queryCheckUserExists.bindValue(":username",self.getUsername())
        queryCheckUserExists.exec_()

        if(queryCheckUserExists.lastError().number() == -1):
            if(queryCheckUserExists.size() > 0):
                return True
            else:
                return False
        else:
            return False