diff --git a/osm_nbi/admin_topics.py b/osm_nbi/admin_topics.py index 768820f37cd43955511f3ede87dfb27da1f55638..b5246cb0185285e24ffaa09354618b3c12026789 100644 --- a/osm_nbi/admin_topics.py +++ b/osm_nbi/admin_topics.py @@ -1085,6 +1085,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"]