Refine user profile access and chat sync

This commit is contained in:
Codex
2026-05-24 10:11:03 +08:00
committed by ekko
parent 3f6a25d8f1
commit 7b05731d44
17 changed files with 223 additions and 57 deletions
@@ -196,7 +196,11 @@ groupChatRoutes.get('/api/hermes/group-chat/rooms', async (ctx) => {
return
}
const rooms = chatServer.getStorage().getAllRooms()
const user = ctx.state.user
const storage = chatServer.getStorage()
const rooms = !user || user.role === 'super_admin'
? storage.getAllRooms()
: storage.getRoomsForProfiles(user.profiles || [])
ctx.body = { rooms }
})