Architecture: How should the 6 contradictory role/permission systems be un...
Documentation for Sessions
🏗️ Architecture: How should the 6 contradictory role/permission systems be un...
Date: 2026-03-14
Time: 16:18:05 UTC
Session: gspace1-218.3
Agent: angular
Confidence: 95%
Status: ✅ Documented
📋 Decision Context
Question:
How should the 6 contradictory role/permission systems be unified?
Task: S220 handoff: Unified role system architecture
🎯 Decision Made
Chosen:
Two-axis model: Platform Role (global, on User: executive/developer/admin/builder/user/guest) + Space Role (per-space, on SpaceMember: owner/admin/editor/viewer). Single derivation function computes everything else (Vitto persona, features, tool access, config permissions, LLM context). Incremental migration — fix 4 bugs first, then build derivation function, then replace systems one by one.
Options Considered:
- No alternatives documented
💭 Reasoning
6 independent systems grew organically. The word 'admin' means 4 different things. Silent bugs include: executive blocked from admin UI, editor maps to level 0, dossier roleLevel always 20, frontend can spoof VittoUserType. The two-axis model is correct because platform identity and space membership ARE different concepts that should not be merged. Everything else (persona, features, config access) is a derived view and should not be stored independently.
📁 Files Involved
libs/libs-api/auth-core/src/lib/auth-core.constants.tslibs/libs-api/auth-core/src/lib/guards/roles.guard.tslibs/libs-ui/auth-ui/src/lib/guards/admin.guard.tsAPIs/backend-vitto-api/src/app/users/user-dossier.service.tsAPIs/backend-vitto-api/src/app/engine/vitto.controller.tsAPIs/backend-vitto-api/src/app/engine/vitto-config.service.tslibs/libs-ai/vitto-chat/src/lib/types/chat.types.ts
🔗 Related
- Decision ID:
dev_1773505085708_xy3aga8 - Session: 218
- Workspace: gspace1
Auto-generated by MCP Smart Consolidation