0
0
Fork 1
mirror of https://mau.dev/maunium/synapse.git synced 2024-11-16 06:51:46 +01:00

Don't apply alias rules to admins

This commit is contained in:
Tulir Asokan 2023-12-12 14:34:01 +02:00
parent 245d82f44e
commit 9572748b56
2 changed files with 3 additions and 3 deletions

View file

@ -174,7 +174,7 @@ class DirectoryHandler:
if not self.config.roomdirectory.is_alias_creation_allowed( if not self.config.roomdirectory.is_alias_creation_allowed(
user_id, room_id, room_alias_str user_id, room_id, room_alias_str
): ) and not is_admin:
# Let's just return a generic message, as there may be all sorts of # Let's just return a generic message, as there may be all sorts of
# reasons why we said no. TODO: Allow configurable error messages # reasons why we said no. TODO: Allow configurable error messages
# per alias creation rule? # per alias creation rule?
@ -510,7 +510,7 @@ class DirectoryHandler:
if not self.config.roomdirectory.is_publishing_room_allowed( if not self.config.roomdirectory.is_publishing_room_allowed(
user_id, room_id, room_aliases user_id, room_id, room_aliases
): ) and not await self.auth.is_server_admin(requester):
# Let's just return a generic message, as there may be all sorts of # Let's just return a generic message, as there may be all sorts of
# reasons why we said no. TODO: Allow configurable error messages # reasons why we said no. TODO: Allow configurable error messages
# per alias creation rule? # per alias creation rule?

View file

@ -927,7 +927,7 @@ class RoomCreationHandler:
room_aliases.append(room_alias.to_string()) room_aliases.append(room_alias.to_string())
if not self.config.roomdirectory.is_publishing_room_allowed( if not self.config.roomdirectory.is_publishing_room_allowed(
user_id, room_id, room_aliases user_id, room_id, room_aliases
): ) and not is_requester_admin:
# allow room creation to continue but do not publish room # allow room creation to continue but do not publish room
await self.store.set_room_is_public(room_id, False) await self.store.set_room_is_public(room_id, False)