@i4e/invest4edu-access-core 0.6.0 → 0.6.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@i4e/invest4edu-access-core",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "Shared access-control primitives for NeoFindesk: tenant keystone, role capabilities, reportee tree, feature flags, and the unified access engine (registry schema, snapshot resolver, visibleWhen).",
5
5
  "type": "module",
6
6
  "exports": {
@@ -173,9 +173,16 @@ export function resolveAccessSnapshot({
173
173
  : mergeGrants(grants, { mappedProducts, now });
174
174
 
175
175
  const byCode = new Map(features.map((f) => [f.feature_code, f]));
176
- const productScope = bypass
176
+ // Product scope comes from the IDENTITY, for admins too. The loader already resolves an
177
+ // unmapped identity (internal staff, platform admins) to every product code, so this is "all"
178
+ // for them without any special case. Deriving a bypass admin's scope from the products declared
179
+ // ON FEATURES — as this used to — yields [] whenever no feature declares one, which is the state
180
+ // of the registry today: a system admin resolved to NO products, and every feature then inherited
181
+ // `products: []`. Kept only as a fallback for the case where identity scope is genuinely empty.
182
+ const identityScope = [...new Set(mappedProducts.map(String))];
183
+ const productScope = bypass && !identityScope.length
177
184
  ? [...new Set(features.flatMap((f) => f.products || []))]
178
- : [...new Set(mappedProducts.map(String))];
185
+ : identityScope;
179
186
 
180
187
  const featureMap = {};
181
188
  const allowedScreens = [];