← Back to list feature
Role-Based Access Control - Module-Level Granularity
mst_modules + role_module pivot + module:xxx middleware - CRUD-level granularity without hardcoded role checks.
Problem
Role checks were scattered, hard to audit and refactor.
Decision
Centralize on mst_modules + role_module + module:xxx middleware.
Result
50+ module-gated routes, CRUD-level granularity, single source of truth.
Implementation
- All primary routes are module-gated; CRUD-level granularity (read/create/update/delete).
- Adding a new module only requires seeding mst_modules + role_module, no code change.