(username)
| 70 | @restricted_access |
| 71 | @admin_permission.require(403) |
| 72 | def updateUser(username): |
| 73 | if userManager is None: |
| 74 | return jsonify(SUCCESS) |
| 75 | |
| 76 | user = userManager.findUser(username) |
| 77 | if user is not None: |
| 78 | if "application/json" in request.headers["Content-Type"]: |
| 79 | data = request.json |
| 80 | |
| 81 | # change roles |
| 82 | roles = ["user"] |
| 83 | if "admin" in data.keys() and data["admin"]: |
| 84 | roles.append("admin") |
| 85 | userManager.changeUserRoles(username, roles) |
| 86 | |
| 87 | # change activation |
| 88 | if "active" in data.keys(): |
| 89 | userManager.changeUserActivation(username, data["active"]) |
| 90 | return getUsers() |
| 91 | else: |
| 92 | abort(404) |
| 93 | |
| 94 | |
| 95 | @api.route("/users/<username>", methods=["DELETE"]) |
nothing calls this directly
no test coverage detected