Refresh HiveGrid Cloud reference snapshot
This commit is contained in:
1 parent
5e99e14772
commit
7f88026f79
5955 files changed
+1177325
-188362
No files matched your search
+20
-3
@@ -58,7 +58,13 @@ export function evaluateProductAccess(input: ProductAccessInput): ProductAccessD
|
||||
};
|
||||
}
|
||||
|
||||
if (tenantOverride === "enabled" && !blueprintFeature.tenantToggleable) {
|
||||
// A non-toggleable feature cannot be self-enabled by a tenant override — EXCEPT for
|
||||
// core modules. Fundament D guarantees every tenant already receives each core module
|
||||
// (`includedInCore`), so a redundant "enabled" override on a non-toggleable core module
|
||||
// (e.g. dashboard, crm-basic, users) is a harmless no-op, not a denial. Real add-ons
|
||||
// (`includedInCore: false`, e.g. Email-Marketing credits) keep the not-toggleable
|
||||
// rejection: a tenant must not self-enable an add-on it did not purchase.
|
||||
if (tenantOverride === "enabled" && !blueprintFeature.tenantToggleable && blueprintFeature.includedInCore !== true) {
|
||||
return {
|
||||
...base,
|
||||
allowed: false,
|
||||
@@ -76,7 +82,16 @@ export function evaluateProductAccess(input: ProductAccessInput): ProductAccessD
|
||||
period: input.period,
|
||||
});
|
||||
|
||||
if (!entitlement.allowed && tenantOverride !== "enabled") {
|
||||
// Fundament D: core modules are always included. A tenant without an active
|
||||
// subscription (or on a plan that lists the feature as not-included/exhausted) still
|
||||
// gets full access to every core module — the plan-gate is removed for core. Only
|
||||
// real add-ons (Email-Marketing) keep the subscription plan-gate and fall through to
|
||||
// the denied passthrough below. The tenant role permission (RBAC) check further down
|
||||
// is NOT a plan-gate: it stays enforced for core and add-on features alike.
|
||||
const includedInCore = blueprintFeature.includedInCore === true;
|
||||
const entitlementAllowed = entitlement.allowed || includedInCore;
|
||||
|
||||
if (!entitlementAllowed && tenantOverride !== "enabled") {
|
||||
return { ...entitlement, blueprintId: input.blueprintId, tenantOverride };
|
||||
}
|
||||
|
||||
@@ -98,7 +113,9 @@ export function evaluateProductAccess(input: ProductAccessInput): ProductAccessD
|
||||
blueprintId: input.blueprintId,
|
||||
tenantOverride,
|
||||
allowed: true,
|
||||
reason: tenantOverride === "enabled" && !entitlement.allowed ? "included" : entitlement.reason,
|
||||
// Access rescued by core-inclusion or an explicit enabled override: the underlying
|
||||
// entitlement reason is a denial, so surface a clean "included" instead.
|
||||
reason: entitlement.allowed ? entitlement.reason : "included",
|
||||
requiredTenantRolePermission: requiredPermission,
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user