mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 11:16:07 -04:00
Add set_user_admin function to the module API (#12341)
This commit is contained in:
parent
bebf994ee8
commit
4e900ece42
3 changed files with 26 additions and 0 deletions
|
@ -515,6 +515,17 @@ class ModuleApi:
|
|||
"""
|
||||
return await self._store.is_server_admin(UserID.from_string(user_id))
|
||||
|
||||
async def set_user_admin(self, user_id: str, admin: bool) -> None:
|
||||
"""Sets if a user is a server admin.
|
||||
|
||||
Added in Synapse v1.56.0.
|
||||
|
||||
Args:
|
||||
user_id: The Matrix ID of the user to set admin status for.
|
||||
admin: True iff the user is to be a server admin, false otherwise.
|
||||
"""
|
||||
await self._store.set_server_admin(UserID.from_string(user_id), admin)
|
||||
|
||||
def get_qualified_user_id(self, username: str) -> str:
|
||||
"""Qualify a user id, if necessary
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue