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>
This commit is contained in:
Jason Robinson 2021-10-26 12:01:06 +03:00 committed by GitHub
parent c1510c97b5
commit 63cbdd8af0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 80 additions and 2 deletions

View file

@ -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