Fix RLS entitlement check + fix role page with RLS on object without object-permission not being displayed (#17326)

This commit is contained in:
Weiko
2026-01-22 11:48:24 +01:00
committed by GitHub
parent f10515fc2d
commit 670ff1583e
7 changed files with 48 additions and 26 deletions
@@ -360,8 +360,9 @@ export class RowLevelPermissionPredicateGroupService {
private async hasRowLevelPermissionFeature(
workspaceId: string,
): Promise<boolean> {
const isBillingEnabled = this.configService.get('IS_BILLING_ENABLED');
const entrepriseKey = this.configService.get('ENTERPRISE_KEY');
const hasValidEnterpriseKey = isDefined(
this.configService.get('ENTERPRISE_KEY'),
);
const isRowLevelPermissionEnabled =
await this.billingService.hasEntitlement(
@@ -369,11 +370,7 @@ export class RowLevelPermissionPredicateGroupService {
BillingEntitlementKey.RLS,
);
if (isDefined(entrepriseKey)) {
return true;
}
return isBillingEnabled && isRowLevelPermissionEnabled;
return hasValidEnterpriseKey && isRowLevelPermissionEnabled;
}
private async hasRowLevelPermissionFeatureOrThrow(workspaceId: string) {
@@ -718,8 +718,9 @@ export class RowLevelPermissionPredicateService {
private async hasRowLevelPermissionFeature(
workspaceId: string,
): Promise<boolean> {
const isBillingEnabled = this.configService.get('IS_BILLING_ENABLED');
const entrepriseKey = this.configService.get('ENTERPRISE_KEY');
const hasValidEnterpriseKey = isDefined(
this.configService.get('ENTERPRISE_KEY'),
);
const isRowLevelPermissionEnabled =
await this.billingService.hasEntitlement(
@@ -727,11 +728,7 @@ export class RowLevelPermissionPredicateService {
BillingEntitlementKey.RLS,
);
if (isDefined(entrepriseKey)) {
return true;
}
return isBillingEnabled && isRowLevelPermissionEnabled;
return hasValidEnterpriseKey && isRowLevelPermissionEnabled;
}
private async hasRowLevelPermissionFeatureOrThrow(workspaceId: string) {