diff --git a/osm_nbi/admin_topics.py b/osm_nbi/admin_topics.py index ca886dc0f11114336330311ba6582193781a3f17..7c6ad9caef29daea7c7f41a2556ec272f13f2f39 100644 --- a/osm_nbi/admin_topics.py +++ b/osm_nbi/admin_topics.py @@ -1096,6 +1096,16 @@ class UserTopicAuth(UserTopic): http_code=HTTPStatus.BAD_REQUEST, ) + # username change + if indata.get("username"): + if not session.get("admin_show"): + if not indata.get("system_admin_id"): + if _id != session["user_id"]: + raise EngineException( + "You are not allowed to change other users username", + http_code=HTTPStatus.BAD_REQUEST, + ) + # user = self.show(session, _id) # Already in 'content' original_mapping = content["project_role_mappings"]