From d12367500849c2af1b6db31ade572a66c27e7547 Mon Sep 17 00:00:00 2001 From: networkException Date: Wed, 13 May 2026 07:55:08 +0200 Subject: [PATCH] feat: auto create rooms for tokens with the RoomCreate grant (#4320) This patch updates the check for auto creating rooms to also consider the RoomCreate grant per token instead of just the global config option. With this patch, applications can decide on their own whether users or which users can auto create rooms. This allows applications that rely on auto creation (saving an API call) to co-exist with those who might want to mint tokens for subscribe-only users. Specifically LaSuite Meet relies on the auto create behavior, however enabling the global config option would make a MatrixRTC deployment vulnerable to abuse, as users on remote homeservers get tokens in order to subscribe. --- pkg/service/roomallocator.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/service/roomallocator.go b/pkg/service/roomallocator.go index 43d0edc0..436a433c 100644 --- a/pkg/service/roomallocator.go +++ b/pkg/service/roomallocator.go @@ -174,7 +174,7 @@ func (r *StandardRoomAllocator) SelectRoomNode(ctx context.Context, roomName liv func (r *StandardRoomAllocator) ValidateCreateRoom(ctx context.Context, roomName livekit.RoomName) error { // when auto create is disabled, we'll check to ensure it's already created - if !r.config.Room.AutoCreate { + if !r.config.Room.AutoCreate && EnsureCreatePermission(ctx) != nil { _, _, err := r.roomStore.LoadRoom(ctx, roomName, false) if err != nil { return err