mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-05 20:44:12 -04:00
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
2 changed files with 8 additions and 0 deletions
|
@ -645,6 +645,13 @@ class RoomCreationHandler(BaseHandler):
|
|||
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue