[rooms] fix issue where dev/mod cant make private instance of unowned room

This commit is contained in:
Devin Zuczek
2026-10-10 15:13:22 -04:00
parent 9a3ab3e50c
commit dd687f02d7
3 changed files with 37 additions and 15 deletions
@@ -5782,6 +5782,15 @@ describe('rooms endpoints', () => {
expect((await get(light, '999')).status).toBe(200)
await clearPresence(999)
expect((await get(light, '999')).status).toBe(403)
// Staff read it from anywhere: the client asks for this list BEFORE it matchmakes a
// private instance, so a developer with no role on the room and no presence in it
// would otherwise be refused the instance.
const staff = async (roles: string[]) =>
SELF.fetch(`${ORIGIN}${light}`, { headers: await bearer('999', roles) })
expect((await staff(['gameClient', 'developer'])).status).toBe(200)
expect((await staff(['gameClient', 'moderator'])).status).toBe(200)
expect((await staff(['gameClient'])).status).toBe(403)
})
it('GET /rooms/:id/subrooms/:sid/saves/:saveId is the detail behind a history row', async () => {