summary refs log tree commit diff
path: root/synapse/handlers
diff options
context:
space:
mode:
authorOlivier Wilkinson (reivilibre) <olivier@librepush.net>2019-08-19 14:42:55 +0100
committerOlivier Wilkinson (reivilibre) <olivier@librepush.net>2019-08-19 14:42:55 +0100
commitebd2cd84d559dd4508472be57fd5a157ddc527eb (patch)
tree6db44c2b188d81cc61e91b76ac78bd67b189d04a /synapse/handlers
parentIntroduce `set_server_admin` as dual to `is_server_admin`. (diff)
downloadsynapse-ebd2cd84d559dd4508472be57fd5a157ddc527eb.tar.xz
Add admin API for setting the admin bit of a user.
Diffstat (limited to 'synapse/handlers')
-rw-r--r--synapse/handlers/admin.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/synapse/handlers/admin.py b/synapse/handlers/admin.py
index 2f22f56ca4..d30a68b650 100644
--- a/synapse/handlers/admin.py
+++ b/synapse/handlers/admin.py
@@ -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.