diff options
author | Nicolas Werner <89468146+nico-famedly@users.noreply.github.com> | 2022-03-23 11:48:47 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-23 12:48:47 +0100 |
commit | 692b82838e29e4904b07b34c5c59cf2598b672ec (patch) | |
tree | f46b8e5de9ca408bdfe79afa310514c799946286 /synapse/module_api | |
parent | Rename shared_rooms to mutual_rooms (#12036) (diff) | |
download | synapse-692b82838e29e4904b07b34c5c59cf2598b672ec.tar.xz |
Allow registering admin users using the module API (#12250)
Signed-off-by: Nicolas Werner <n.werner@famedly.com>
Diffstat (limited to 'synapse/module_api')
-rw-r--r-- | synapse/module_api/__init__.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/synapse/module_api/__init__.py b/synapse/module_api/__init__.py index aa8256b36f..a628faaf65 100644 --- a/synapse/module_api/__init__.py +++ b/synapse/module_api/__init__.py @@ -611,15 +611,18 @@ class ModuleApi: localpart: str, displayname: Optional[str] = None, emails: Optional[List[str]] = None, + admin: bool = False, ) -> "defer.Deferred[str]": """Registers a new user with given localpart and optional displayname, emails. Added in Synapse v1.2.0. + Changed in Synapse v1.56.0: add 'admin' argument to register the user as admin. Args: localpart: The localpart of the new user. displayname: The displayname of the new user. emails: Emails to bind to the new user. + admin: True if the user should be registered as a server admin. Raises: SynapseError if there is an error performing the registration. Check the @@ -633,6 +636,7 @@ class ModuleApi: localpart=localpart, default_display_name=displayname, bind_emails=emails or [], + admin=admin, ) ) |