feat: add voice disconnect permission and fix federation identity

- Add DISCONNECT_MEMBERS permission (bit 27) to disconnect users from voice
- Implement voice_disconnect WebSocket handler with permission checks
- Add disconnect button to voice user context menu
- Grant instance admins full permissions across all spaces
- Fix voice_disconnected handler to use federation-aware identity resolution
- Update CLAUDE.md with new event types and permission docs
This commit is contained in:
Jannis Braun
2026-03-10 02:13:20 +01:00
parent 3cef9cef32
commit e8fc40ab34
8 changed files with 92 additions and 2 deletions
+4
View File
@@ -32,6 +32,10 @@ export function computePermissions(userId: string, spaceId: string, channelId?:
if (!space) return 0n;
if (space.ownerId === userId) return ALL_PERMISSIONS;
// 1b. Instance admin — full access across all spaces
const userRow = db.select().from(schema.users).where(eq(schema.users.id, userId)).get();
if (userRow?.isAdmin === 1) return ALL_PERMISSIONS;
// 2. Base permissions from @everyone role (id === spaceId)
const everyoneRole = db.select().from(schema.roles)
.where(and(eq(schema.roles.id, spaceId), eq(schema.roles.spaceId, spaceId)))