Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Check publishing permissions #7260

Merged
merged 4 commits into from
Apr 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/7260.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix room publish permissions not being checked on room creation.
PeerD marked this conversation as resolved.
Show resolved Hide resolved
7 changes: 7 additions & 0 deletions synapse/handlers/room.py
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,13 @@ def create_room(self, requester, config, ratelimit=True, creator_join_profile=No
check_membership=False,
)

if is_public:
if not self.config.is_publishing_room_allowed(user_id, room_id, room_alias):
# Lets just return a generic message, as there may be all sorts of
# reasons why we said no. TODO: Allow configurable error messages
# per alias creation rule?
raise SynapseError(403, "Not allowed to publish room")

preset_config = config.get(
"preset",
RoomCreationPreset.PRIVATE_CHAT
Expand Down