feat: implement complete RBAC access control with tests
Add 4-layer access control stack (subscription → module → menu → permissions): - P1: Wire requires_permission into menu sidebar filtering - P2: Expose window.USER_PERMISSIONS for Alpine.js client-side gating - P3: Add page-level permission guards on store routes - P4: Role CRUD API endpoints and role editor UI - P5: Audit trail for all role/permission changes Includes unit tests (menu permission filtering, role CRUD service) and integration tests (role API endpoints). All 404 core+tenancy tests pass. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -158,6 +158,7 @@ core_module = ModuleDefinition(
|
||||
route="/store/{store_code}/dashboard",
|
||||
order=10,
|
||||
is_mandatory=True,
|
||||
requires_permission="dashboard.view",
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -181,6 +182,7 @@ core_module = ModuleDefinition(
|
||||
route="/store/{store_code}/settings",
|
||||
order=20,
|
||||
is_mandatory=True,
|
||||
requires_permission="settings.view",
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user