feat: Update room properties to support cloning for RRO/AG base rooms; adjust moderation logic for cloning permissions

This commit is contained in:
Alexa
2026-07-13 01:04:10 +03:00
parent 1152d9ba48
commit a2ffb5ef4b
2 changed files with 10 additions and 3 deletions
@@ -972,7 +972,11 @@ public class RoomsModerationController(DorkNetDbContext db) : ControllerBase
var newName = await ReadCloneNameAsync();
var source = await db.Rooms.FirstOrDefaultAsync(r => r.Id == roomId);
if (source is null) return NotFound();
if (!source.CloningAllowed && source.CreatorPlayerId != Me)
// RRO/AG rooms are first-party templates meant to be cloned — the
// room-creation "base room" picker starts a new build by cloning one
// (RecCenter, MakerRoom, …). Their seed rows have CloningAllowed=false,
// so without the IsAGRoom exception every base-room create 403s.
if (!source.CloningAllowed && !source.IsAGRoom && source.CreatorPlayerId != Me)
return Forbid();
if (string.IsNullOrWhiteSpace(newName))