feat: bitwise RBAC engine with channel-level permission overrides

Replace string-based role checks (role === 'admin') with a bitwise BigInt
permission system. Adds computePermissions() resolution engine following
Discord's model: @everyone base → role union → admin shortcut → channel
overrides (role deny/allow → member deny/allow). Ready payload now filters
channels by VIEW_CHANNEL and attaches per-user myPermissions to each
server and channel. Includes channel_overrides table, @everyone role
auto-creation, migration for existing servers, and override CRUD API.
This commit is contained in:
Jannis Braun
2026-02-24 05:08:59 +01:00
parent 024833c470
commit 8030c89c6c
19 changed files with 568 additions and 93 deletions
+3 -1
View File
@@ -6,7 +6,9 @@
"main": "./src/types.ts",
"types": "./src/types.ts",
"exports": {
".": "./src/types.ts"
".": "./src/types.ts",
"./src/permissions": "./src/permissions.ts",
"./src/permissions.js": "./src/permissions.ts"
},
"scripts": {
"build": "tsc",