http_code=HTTPStatus.UNPROCESSABLE_ENTITY,
)
+ # password change
+ if indata.get("password"):
+ 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 password",
+ http_code=HTTPStatus.BAD_REQUEST,
+ )
+ if not indata.get("old_password"):
+ raise EngineException(
+ "Password change requires old password or admin ID",
+ http_code=HTTPStatus.BAD_REQUEST,
+ )
+
# user = self.show(session, _id) # Already in 'content'
original_mapping = content["project_role_mappings"]
"username": token_info["username"],
"user_id": token_info["user_id"],
"admin": token_info["admin"],
+ "admin_show": token_info["admin_show"],
"public": None,
"allow_show_user_project_role": token_info["allow_show_user_project_role"],
}