fix(db): make Edit leads and Export leads grantable url-less M modules

The Roles screen only grants type M modules, so type A could never be
granted. A url-less M module with no children stays out of the sidebar.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
This commit is contained in:
ngqileandClaude Opus 5.5 committed 2026-11-27 16:12:21 +08:00
1 parent 6ab495ad3e
commit 6855906cf1
4 files changed
+13 -10

No files matched your search

@@ -12,7 +12,7 @@ Change 4a (`openspec/changes/archive/2026-11-27-add-event-lead-capture/`) added
**Access control:**
- `@AdminModule` allows a caller holding any one of the listed modules (`AppAccessAspect`). `AdminModuleAccess.grantedAny` checks modules in code.
- Modules of type `A` (action) are granted like any module and show in the Roles access tree. The sidebar never shows them (`aclSidebar.ts`).
- Only modules of type `M` can be granted on the Roles screen (`AdminAclService.isGrantable`); type `A` is refused with `UNKNOWN_MODULE`. The sidebar hides an `M` module that has no url and no children (`aclSidebar.ts`, with a test).
- The portal checks access with `useAdminAuth().hasModule(name)`.
**Data facts:**
@@ -48,10 +48,12 @@ See proposal.md for why.
| id | name | desc | type | url | icon_name |
|---|---|---|---|---|---|
| 40400000 | `BO_LEADS` | Leads | `M` | `/leads` | `Users` |
| 40500000 | `BO_LEADS_EDIT` | Edit leads | `A` | NULL | NULL |
| 40600000 | `BO_LEADS_EXPORT` | Export leads | `A` | NULL | NULL |
| 40500000 | `BO_LEADS_EDIT` | Edit leads | `M` | NULL | NULL |
| 40600000 | `BO_LEADS_EXPORT` | Export leads | `M` | NULL | NULL |
**Placement:** the two action modules sit directly under the root, not under `BO_LEADS`. That way a role with only `BO_EVENT_LEADS` can still be given export.
**Edit and Export modules:** these are url-less `M` modules, so they can be granted and never show in the sidebar. A first draft used type `A`, which the Roles screen cannot grant.
**Placement:** the two modules sit directly under the root, not under `BO_LEADS`. That way a role with only `BO_EVENT_LEADS` can still be given export.
**Files:** `sql/01-lead-index.sql`, `sql/02-lead-modules.sql`, `sql/99-rollback.sql`, all mirrored in `local/seed/03-colite.sql`.