Check on room creation if the user is allowed to publish the room to the room directory. (#7260)
This commit is contained in:
parent
118b58f0c9
commit
f41b742161
|
@ -0,0 +1 @@
|
||||||
|
Fix room publish permissions not being checked on room creation.
|
|
@ -645,6 +645,13 @@ class RoomCreationHandler(BaseHandler):
|
||||||
check_membership=False,
|
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_config = config.get(
|
||||||
"preset",
|
"preset",
|
||||||
RoomCreationPreset.PRIVATE_CHAT
|
RoomCreationPreset.PRIVATE_CHAT
|
||||||
|
|
Loading…
Reference in New Issue