diff options
author | Jason Robinson <jasonr@element.io> | 2021-10-26 12:01:06 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-26 09:01:06 +0000 |
commit | 63cbdd8af081839f245915a18ed57f1a44f1a5f4 (patch) | |
tree | 26ee37e15ee168383fb73c25208a429d44bd2306 /synapse/rest/admin | |
parent | Fix cyclic import in the module API (#11180) (diff) | |
download | synapse-63cbdd8af081839f245915a18ed57f1a44f1a5f4.tar.xz |
Enable changing user type via users admin API (#11174)
Users admin API can now also modify user type in addition to allowing it to be set on user creation. Signed-off-by: Jason Robinson <jasonr@matrix.org> Co-authored-by: Brendan Abolivier <babolivier@matrix.org>
Diffstat (limited to 'synapse/rest/admin')
-rw-r--r-- | synapse/rest/admin/users.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/synapse/rest/admin/users.py b/synapse/rest/admin/users.py index c0bebc3cf0..d14fafbbc9 100644 --- a/synapse/rest/admin/users.py +++ b/synapse/rest/admin/users.py @@ -326,6 +326,9 @@ class UserRestServletV2(RestServlet): target_user.to_string() ) + if "user_type" in body: + await self.store.set_user_type(target_user, user_type) + user = await self.admin_handler.get_user(target_user) assert user is not None |