element-hq / element-hq/synapse

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

Open
#18,151 3 comments 5 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
4.6k
Forks
600
Avg merge
5d 22h
Merged PRs (30d)
51

Description

📌 **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](https://element-hq.github.io/synapse/latest/admin_api/rooms.html#room-details-api).
- 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! 😊

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.