synapse icon indicating copy to clipboard operation
synapse copied to clipboard

[Support] Disable the Creation of Rooms and Spaces While Allowing DMs (One-on-One or Group)

Open LayBraid opened this issue 10 months ago β€’ 2 comments

πŸ“Œ Context and Objective
Hello,
We self-host a Synapse server with several pre-configured spaces.

Our objective is to:
βœ… Allow DMs (both one-on-one and group).
β›” Prevent the creation of new public or private rooms.
β›” Prevent the creation of new spaces.

We mainly want to enforce these restrictions to better manage resources and avoid the uncontrolled proliferation of rooms and spaces on our self-hosted infrastructure.

πŸ“Œ Current Management
To restrict the creation of rooms and spaces, we are currently using a plugin based on synapse-user-restrictions.
However, this plugin also blocks the ability to send DMs, which is an unwanted behavior.

πŸ” Research Conducted
Before asking this question, we explored different possibilities:

  • We identified that rooms have a type (room_type), specifically m.space for spaces.
    Reference: Synapse Admin API - Room Details.
  • We wonder if this information could be used to differentiate between spaces, rooms, and DMs to allow only DMs.
  • We noticed that the distinction between group DMs and standard rooms seems unclear in the permission management system.
    • Is there a reliable way to make this distinction?
    • Could room_type be used?
  • We are unsure about the current support for room_type in restriction rules:
    • Is this functionality poorly implemented, deprecated, or simply never considered for this use case?

❓ Questions

  • How can we prevent only the creation of rooms and spaces without blocking DMs?
  • Is room_type (e.g., "m.space") usable to restrict only the creation of spaces and rooms?

Thank you in advance for your help! 😊

LayBraid avatar Feb 10 '25 21:02 LayBraid

From what i'm understanding from the specs and the code, only m.space type is useful in synapse (when I say useful I mean that only spaces have specific logic in the code).

If I understood it well, the room type is set in the content of the create event (m.room.create) and is directly sent by the frontend. Which means that technically synapse is able to store any kind of room type and then you can do data analysis with a custom plugin. However that means changing the frontend and I'm not sure where to address this issue knowing there are multiple frontend

First time I'm diving into synapse codebase so i'm might be wrong

Ruph-QD avatar Mar 17 '25 13:03 Ruph-QD

I would love to see this feature in Synapse!

We host a server for our community and would like to prevent normal users from creating public rooms for two reasons:

  1. Public rooms already exist for most topics. If too many rooms are created, conversations will be spread across them.
  2. It's easier to moderate a limited number of public rooms.

mole99 avatar Apr 24 '25 08:04 mole99

Hello πŸ‘‹,

I’d like to follow up on this topic, as we’re still facing the same challenge on our self-hosted Synapse:

  • βœ… We need to allow one-to-one and group DMs.
  • β›” We want to forbid the creation of new rooms and spaces.

So far, the only workaround we found (using synapse-user-restrictions) unfortunately blocks DMs as well, which makes it unsuitable.

Any update or guidance would be greatly appreciated πŸ™

Thanks in advance!

julesreyn avatar Sep 29 '25 16:09 julesreyn