def updateUser(self,username_old):
        if(self.getUsername() != None):
            self.__openDB()
            sql = "UPDATE public.postnas_search_access_control SET username = :username, name = :name, access = :access WHERE username = :username_old"
            query = QSqlQuery(self.db)
            if (self.dbSchema.lower() != "public"):
                sql = sql.replace("public.", self.dbSchema + ".")
            query.prepare(sql)
            query.bindValue(":username",self.getUsername().lower())
            query.bindValue(":username_old",username_old)
            query.bindValue(":name",self.name)
            query.bindValue(":access",self.access)
            query.exec_()
            if(query.lastError().number() == -1):
                return True
            else:
                QgsMessageLog.logMessage("Datenbankfehler beim Update: " + query.lastError().text(),'PostNAS-Suche', Qgis.Critical)
                return False
        else:
            return False