cabloy 5.1.176 → 5.1.177
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.cabloy-version +1 -1
- package/CHANGELOG.md +7 -0
- package/package.json +1 -1
- package/repo-docs/backend/menu-guide.md +37 -3
- package/zova/pnpm-lock.yaml +1 -1
package/.cabloy-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
5.1.
|
|
1
|
+
5.1.177
|
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -55,9 +55,11 @@ This makes menu retrieval part of the broader backend contract surface.
|
|
|
55
55
|
|
|
56
56
|
In the current repo implementation, the out-of-the-box menu controller is public and delegates directly to `this.scope.service.menu.retrieveMenus(publicPath)`.
|
|
57
57
|
|
|
58
|
-
##
|
|
58
|
+
## SSR Site targeting
|
|
59
59
|
|
|
60
|
-
`@SsrMenu(...)`
|
|
60
|
+
`@SsrMenu(...)` and `@SsrMenuGroup(...)` use `site` to select the SSR Site onion(s) that receive the declaration. It is a navigation-composition filter, not a site-admission, role-visibility, or backend-authorization decision.
|
|
61
|
+
|
|
62
|
+
Use `site` for navigation owned by one SSR Site or deliberately exclusive to a known subset of sites:
|
|
61
63
|
|
|
62
64
|
```typescript
|
|
63
65
|
@SsrMenu({
|
|
@@ -66,10 +68,41 @@ In the current repo implementation, the out-of-the-box menu controller is public
|
|
|
66
68
|
link: 'presetResource',
|
|
67
69
|
roles: ['systemAdmin'],
|
|
68
70
|
},
|
|
69
|
-
|
|
71
|
+
// This Basic Admin-owned entry intentionally targets one SSR Site.
|
|
72
|
+
site: ['basic-siteadmin:admin'],
|
|
73
|
+
})
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
For a shared module declaration intended for every compatible SSR Admin site, omit `site`:
|
|
77
|
+
|
|
78
|
+
```typescript
|
|
79
|
+
@SsrMenu({
|
|
80
|
+
item: {
|
|
81
|
+
title: $locale('SharedOperations'),
|
|
82
|
+
link: 'presetResource',
|
|
83
|
+
roles: ['systemAdmin'],
|
|
84
|
+
},
|
|
85
|
+
// No `site`: the shared declaration is available to compatible SSR Admin sites.
|
|
70
86
|
})
|
|
71
87
|
```
|
|
72
88
|
|
|
89
|
+
Do not bind a shared Admin menu or menu group to the current/default Admin site merely to keep a new independent site's navigation narrow. Isolate an independent site through its enabled module composition and site-owned menus/groups. When a shared capability needs genuinely different navigation contracts per site, use an explicit, approved site-specific composition or owner instead of narrowing the shared declaration by default.
|
|
90
|
+
|
|
91
|
+
`site` is distinct from a role's `siteIds`, menu `roles` or role-menu associations, and Passport/RBAC authorization:
|
|
92
|
+
|
|
93
|
+
```text
|
|
94
|
+
site -> which SSR Site receives a menu/group declaration
|
|
95
|
+
siteIds -> which frontend Site a subject may enter
|
|
96
|
+
roles / role-menu -> which admitted subject may discover a menu leaf
|
|
97
|
+
Passport / RBAC -> which backend actions or data the subject may use
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
See [Menu Authorization](/backend/menu-authorization) for the site-admission, navigation-disclosure, and backend-authority boundaries.
|
|
101
|
+
|
|
102
|
+
## Static menu visibility
|
|
103
|
+
|
|
104
|
+
`@SsrMenu(...)` items can declare static role visibility without changing the public menu DTO:
|
|
105
|
+
|
|
73
106
|
- Omit `roles` to make an item visible to anonymous and authenticated callers.
|
|
74
107
|
- Use `roles: []` when an item has no static role visibility and is intended to be disclosed only through dynamic Role-menu configuration.
|
|
75
108
|
- A nonempty `roles` array is visible when the current Passport has at least one matching role name; it can also be disclosed through dynamic Role-menu configuration.
|
|
@@ -107,5 +140,6 @@ When editing SSR menu behavior, ask:
|
|
|
107
140
|
2. is there a default fallback menu that should remain available?
|
|
108
141
|
3. does the menu contract belong in backend API design, frontend route design, or both?
|
|
109
142
|
4. does the active edition affect the menu structure or public path assumptions?
|
|
143
|
+
5. is this declaration site-owned or deliberately site-exclusive (specify `site`), or shared across compatible SSR Admin sites (omit `site`)?
|
|
110
144
|
|
|
111
145
|
That helps AI keep menu behavior aligned with Cabloy’s shared SSR architecture.
|
package/zova/pnpm-lock.yaml
CHANGED