summary refs log tree commit diff
path: root/synapse/handlers/room.py
diff options
context:
space:
mode:
authorBrendan Abolivier <babolivier@matrix.org>2021-07-20 12:39:46 +0200
committerGitHub <noreply@github.com>2021-07-20 12:39:46 +0200
commita743bf46949e851c9a10d8e01a138659f3af2484 (patch)
treefc6fe51e777b197c83d3aef49011fe13d35b7130 /synapse/handlers/room.py
parentFix exception when failing to get remote room list (#10414) (diff)
downloadsynapse-a743bf46949e851c9a10d8e01a138659f3af2484.tar.xz
Port the ThirdPartyEventRules module interface to the new generic interface (#10386)
Port the third-party event rules interface to the generic module interface introduced in v1.37.0
Diffstat (limited to 'synapse/handlers/room.py')
-rw-r--r--synapse/handlers/room.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/synapse/handlers/room.py b/synapse/handlers/room.py
index 64656fda22..370561e549 100644
--- a/synapse/handlers/room.py
+++ b/synapse/handlers/room.py
@@ -618,15 +618,11 @@ class RoomCreationHandler(BaseHandler):
         else:
             is_requester_admin = await self.auth.is_server_admin(requester.user)
 
-        # Check whether the third party rules allows/changes the room create
-        # request.
-        event_allowed = await self.third_party_event_rules.on_create_room(
+        # Let the third party rules modify the room creation config if needed, or abort
+        # the room creation entirely with an exception.
+        await self.third_party_event_rules.on_create_room(
             requester, config, is_requester_admin=is_requester_admin
         )
-        if not event_allowed:
-            raise SynapseError(
-                403, "You are not permitted to create rooms", Codes.FORBIDDEN
-            )
 
         if not is_requester_admin and not await self.spam_checker.user_may_create_room(
             user_id