Add Admin API capability to set adminship of a user (#5878)

Admin API: Set adminship of a user
This commit is contained in:
reivilibre 2019-08-27 10:14:00 +01:00 committed by GitHub
parent 8767b63a82
commit 1a7e6eb633
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 132 additions and 0 deletions

View file

@ -94,6 +94,16 @@ class AdminHandler(BaseHandler):
return ret
def set_user_server_admin(self, user, admin):
"""
Set the admin bit on a user.
Args:
user_id (UserID): the (necessarily local) user to manipulate
admin (bool): whether or not the user should be an admin of this server
"""
return self.store.set_server_admin(user, admin)
@defer.inlineCallbacks
def export_user_data(self, user_id, writer):
"""Write all data we have on the user to the given writer.