mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-12-11 05:19:28 -05:00
parent
380122866f
commit
bbeee33d63
4 changed files with 195 additions and 39 deletions
|
|
@ -301,12 +301,16 @@ class RegistrationWorkerStore(SQLBaseStore):
|
|||
admin (bool): true iff the user is to be a server admin,
|
||||
false otherwise.
|
||||
"""
|
||||
return self.db.simple_update_one(
|
||||
table="users",
|
||||
keyvalues={"name": user.to_string()},
|
||||
updatevalues={"admin": 1 if admin else 0},
|
||||
desc="set_server_admin",
|
||||
)
|
||||
|
||||
def set_server_admin_txn(txn):
|
||||
self.db.simple_update_one_txn(
|
||||
txn, "users", {"name": user.to_string()}, {"admin": 1 if admin else 0}
|
||||
)
|
||||
self._invalidate_cache_and_stream(
|
||||
txn, self.get_user_by_id, (user.to_string(),)
|
||||
)
|
||||
|
||||
return self.db.runInteraction("set_server_admin", set_server_admin_txn)
|
||||
|
||||
def _query_for_auth(self, txn, token):
|
||||
sql = (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue