Architecture: How should role types be defined in the user-management modu...
Documentation for Sessions
🏗️ Architecture: How should role types be defined in the user-management modu...
Date: 2026-03-12
Time: 19:26:53 UTC
Session: gspace1-210.3
Agent: architecture
Confidence: 95%
Status: ✅ Documented
📋 Decision Context
Question:
How should role types be defined in the user-management module for portability?
Task: Not specified
🎯 Decision Made
Chosen:
Define UserRole, ROLE_HIERARCHY, and role utilities locally in the module's role.model.ts rather than depending on shared-models SystemRoles enum (which only has 4 roles) or auth-core constants (which is a backend lib)
Options Considered:
- No alternatives documented
💭 Reasoning
The shared-models SystemRoles enum only has ADMIN, MANAGER, USER, VIEWER — missing EXECUTIVE, DEVELOPER, SYSTEM, and GUEST. The auth-core constants have the correct 7 roles but is a backend library. For portability to generated platforms, the module should be self-contained with its own type definitions aligned with auth.types.ts. The role.model.ts defines the complete hierarchy (system=100 through guest=0) plus utility functions like canManageRole(), getAssignableRoles(), and isAdminRole().
📁 Files Involved
modules/core-modules/user-management/src/lib/models/role.model.tslibs/core/shared-models/src/lib/rbac/role.tslibs/libs-api/auth-core/src/lib/auth-core.constants.ts
🔗 Related
- Decision ID:
dev_1773343613580_qejcncy - Session: 210
- Workspace: gspace1
Auto-generated by MCP Smart Consolidation