diff options
author | Erik Johnston <erik@matrix.org> | 2017-03-20 17:25:41 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2017-03-20 17:25:41 +0000 |
commit | e0e214556a82370528ef1f9943773c42270c5336 (patch) | |
tree | 7fcbb016a63202eb1733e6b69a4999ba94193e8c /synapse/rest/client/v1/profile.py | |
parent | Merge pull request #2028 from majewsky/readme-fix-1 (diff) | |
parent | Bump changelog and version (diff) | |
download | synapse-e0e214556a82370528ef1f9943773c42270c5336.tar.xz |
Merge branch 'release-v0.19.3' of github.com:matrix-org/synapse v0.19.3
Diffstat (limited to 'synapse/rest/client/v1/profile.py')
-rw-r--r-- | synapse/rest/client/v1/profile.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/rest/client/v1/profile.py b/synapse/rest/client/v1/profile.py index 355e82474b..1a5045c9ec 100644 --- a/synapse/rest/client/v1/profile.py +++ b/synapse/rest/client/v1/profile.py @@ -46,6 +46,7 @@ class ProfileDisplaynameRestServlet(ClientV1RestServlet): def on_PUT(self, request, user_id): requester = yield self.auth.get_user_by_req(request, allow_guest=True) user = UserID.from_string(user_id) + is_admin = yield self.auth.is_server_admin(requester.user) content = parse_json_object_from_request(request) @@ -55,7 +56,7 @@ class ProfileDisplaynameRestServlet(ClientV1RestServlet): defer.returnValue((400, "Unable to parse name")) yield self.handlers.profile_handler.set_displayname( - user, requester, new_name) + user, requester, new_name, is_admin) defer.returnValue((200, {})) @@ -88,6 +89,7 @@ class ProfileAvatarURLRestServlet(ClientV1RestServlet): def on_PUT(self, request, user_id): requester = yield self.auth.get_user_by_req(request) user = UserID.from_string(user_id) + is_admin = yield self.auth.is_server_admin(requester.user) content = parse_json_object_from_request(request) try: @@ -96,7 +98,7 @@ class ProfileAvatarURLRestServlet(ClientV1RestServlet): defer.returnValue((400, "Unable to parse name")) yield self.handlers.profile_handler.set_avatar_url( - user, requester, new_name) + user, requester, new_name, is_admin) defer.returnValue((200, {})) |