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:
+5
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user