Add RLS Entitlement check (#17179)

## Context
- Add RLS entitlement to billing
- Check value in the backend (for RLS predicate entity
queries/mutations)
- Expose billingEntitlements to the API inside currentWorkspace to check
available features to the workspace and display the role components
accordingly
- Cleanup RLS when plan changes back to one without RLS.

This should cover almost everything, imho we don't need to check in the
ORM because => We can't create RLS without the correct PLAN and
switching back to a PLAN without RLS deletes existing RLS through
stripes webhooks
This commit is contained in:
Weiko
2026-01-20 17:06:37 +01:00
committed by GitHub
parent 579c59bd11
commit b6635ba272
26 changed files with 314 additions and 24 deletions
@@ -13,6 +13,7 @@ import {
type EmailsFilter,
type FloatFilter,
type FullNameFilter,
type IsFilter,
type LeafObjectRecordFilter,
type LinksFilter,
type MultiSelectFilter,
@@ -210,6 +211,10 @@ export const isRecordMatchingRLSRowLevelPermissionPredicate = ({
const recordFieldValue = record[filterKey];
if (!isDefined(recordFieldValue)) {
if (isObject(filterValue)) {
return (filterValue as { is?: IsFilter })?.is === 'NULL';
}
return false;
}