chore: remove IS_ROW_LEVEL_PERMISSION_PREDICATES_ENABLED and IS_DATE_TIME_WHOLE_DAY_FILTER_ENABLED feature flags (#19082)
## Summary - Removes `IS_ROW_LEVEL_PERMISSION_PREDICATES_ENABLED` feature flag, making row-level permission predicates always enabled. Removes early-return guards from query builders (select, update, insert) and the shared utility, the public feature flag metadata entry, and `updateFeatureFlag` calls from integration tests. - Removes `IS_DATE_TIME_WHOLE_DAY_FILTER_ENABLED` feature flag, making whole-day datetime filtering always enabled. Simplifies filter input components and hooks to always use date-only format for `IS` operand on `DATE_TIME` fields. - Cleans up enum definitions, seed data, generated schema files, and test mocks for both flags.
This commit is contained in:
-9
@@ -20,15 +20,6 @@ export const PUBLIC_FEATURE_FLAGS: PublicFeatureFlag[] = [
|
||||
'Enable many-to-many relations through junction tables configuration',
|
||||
},
|
||||
},
|
||||
{
|
||||
key: FeatureFlagKey.IS_ROW_LEVEL_PERMISSION_PREDICATES_ENABLED,
|
||||
metadata: {
|
||||
label: 'Row Level Permissions',
|
||||
description: 'Enable row level permission',
|
||||
imagePath:
|
||||
'https://twenty.com/images/lab/is-row-level-permission-predicates-enabled.png',
|
||||
},
|
||||
},
|
||||
...(process.env.CLOUDFLARE_API_KEY
|
||||
? [
|
||||
// {
|
||||
|
||||
-3
@@ -237,11 +237,9 @@ describe('WorkspaceEntityManager', () => {
|
||||
IS_RECORD_PAGE_LAYOUT_EDITING_ENABLED: false,
|
||||
IS_PUBLIC_DOMAIN_ENABLED: false,
|
||||
IS_EMAILING_DOMAIN_ENABLED: false,
|
||||
IS_ROW_LEVEL_PERMISSION_PREDICATES_ENABLED: false,
|
||||
IS_JUNCTION_RELATIONS_ENABLED: false,
|
||||
IS_COMMAND_MENU_ITEM_ENABLED: false,
|
||||
IS_NAVIGATION_MENU_ITEM_ENABLED: false,
|
||||
IS_DATE_TIME_WHOLE_DAY_FILTER_ENABLED: false,
|
||||
IS_NAVIGATION_MENU_ITEM_EDITING_ENABLED: false,
|
||||
IS_DRAFT_EMAIL_ENABLED: false,
|
||||
IS_USAGE_ANALYTICS_ENABLED: false,
|
||||
@@ -274,7 +272,6 @@ describe('WorkspaceEntityManager', () => {
|
||||
IS_AI_ENABLED: false,
|
||||
IS_PUBLIC_DOMAIN_ENABLED: false,
|
||||
IS_EMAILING_DOMAIN_ENABLED: false,
|
||||
IS_ROW_LEVEL_PERMISSION_PREDICATES_ENABLED: false,
|
||||
},
|
||||
permissionsPerRoleId: {},
|
||||
eventEmitterService: mockInternalContext.eventEmitterService,
|
||||
|
||||
+1
-9
@@ -1,4 +1,4 @@
|
||||
import { FeatureFlagKey, type ObjectsPermissions } from 'twenty-shared/types';
|
||||
import { type ObjectsPermissions } from 'twenty-shared/types';
|
||||
import { isDefined } from 'twenty-shared/utils';
|
||||
import {
|
||||
type EntityTarget,
|
||||
@@ -317,14 +317,6 @@ export class WorkspaceInsertQueryBuilder<
|
||||
}
|
||||
|
||||
private validateRLSPredicatesForInsert(): void {
|
||||
if (
|
||||
this.featureFlagMap[
|
||||
FeatureFlagKey.IS_ROW_LEVEL_PERMISSION_PREDICATES_ENABLED
|
||||
] !== true
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
const mainAliasTarget = this.getMainAliasTarget();
|
||||
const objectMetadata = getObjectMetadataFromEntityTarget(
|
||||
mainAliasTarget,
|
||||
|
||||
+1
-9
@@ -1,4 +1,4 @@
|
||||
import { FeatureFlagKey, type ObjectsPermissions } from 'twenty-shared/types';
|
||||
import { type ObjectsPermissions } from 'twenty-shared/types';
|
||||
import {
|
||||
type EntityTarget,
|
||||
type ObjectLiteral,
|
||||
@@ -357,14 +357,6 @@ export class WorkspaceSelectQueryBuilder<
|
||||
}
|
||||
|
||||
private applyRowLevelPermissionPredicates(): void {
|
||||
if (
|
||||
this.featureFlagMap[
|
||||
FeatureFlagKey.IS_ROW_LEVEL_PERMISSION_PREDICATES_ENABLED
|
||||
] !== true
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.shouldBypassPermissionChecks) {
|
||||
return;
|
||||
}
|
||||
|
||||
+1
-17
@@ -1,6 +1,6 @@
|
||||
import { msg } from '@lingui/core/macro';
|
||||
import { QUERY_MAX_RECORDS } from 'twenty-shared/constants';
|
||||
import { FeatureFlagKey, type ObjectsPermissions } from 'twenty-shared/types';
|
||||
import { type ObjectsPermissions } from 'twenty-shared/types';
|
||||
import { isDefined } from 'twenty-shared/utils';
|
||||
import {
|
||||
UpdateQueryBuilder,
|
||||
@@ -615,14 +615,6 @@ export class WorkspaceUpdateQueryBuilder<
|
||||
}
|
||||
|
||||
private applyRowLevelPermissionPredicates(): void {
|
||||
if (
|
||||
this.featureFlagMap[
|
||||
FeatureFlagKey.IS_ROW_LEVEL_PERMISSION_PREDICATES_ENABLED
|
||||
] !== true
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.shouldBypassPermissionChecks) {
|
||||
return;
|
||||
}
|
||||
@@ -648,14 +640,6 @@ export class WorkspaceUpdateQueryBuilder<
|
||||
}: {
|
||||
updatedRecords: T[];
|
||||
}): void {
|
||||
if (
|
||||
this.featureFlagMap[
|
||||
FeatureFlagKey.IS_ROW_LEVEL_PERMISSION_PREDICATES_ENABLED
|
||||
] !== true
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
const mainAliasTarget = this.getMainAliasTarget();
|
||||
const objectMetadata = getObjectMetadataFromEntityTarget(
|
||||
mainAliasTarget,
|
||||
|
||||
-9
@@ -1,6 +1,5 @@
|
||||
/* @license Enterprise */
|
||||
|
||||
import { FeatureFlagKey } from 'twenty-shared/types';
|
||||
import {
|
||||
Brackets,
|
||||
NotBrackets,
|
||||
@@ -33,14 +32,6 @@ export const applyRowLevelPermissionPredicates = <T extends ObjectLiteral>({
|
||||
authContext,
|
||||
featureFlagMap,
|
||||
}: ApplyRowLevelPermissionPredicatesArgs<T>): void => {
|
||||
if (
|
||||
featureFlagMap[
|
||||
FeatureFlagKey.IS_ROW_LEVEL_PERMISSION_PREDICATES_ENABLED
|
||||
] !== true
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
const userWorkspaceId = isUserAuthContext(authContext)
|
||||
? authContext.userWorkspaceId
|
||||
: undefined;
|
||||
|
||||
-10
@@ -40,11 +40,6 @@ export const seedFeatureFlags = async ({
|
||||
workspaceId: workspaceId,
|
||||
value: true,
|
||||
},
|
||||
{
|
||||
key: FeatureFlagKey.IS_ROW_LEVEL_PERMISSION_PREDICATES_ENABLED,
|
||||
workspaceId: workspaceId,
|
||||
value: true,
|
||||
},
|
||||
{
|
||||
key: FeatureFlagKey.IS_JUNCTION_RELATIONS_ENABLED,
|
||||
workspaceId: workspaceId,
|
||||
@@ -70,11 +65,6 @@ export const seedFeatureFlags = async ({
|
||||
workspaceId: workspaceId,
|
||||
value: true,
|
||||
},
|
||||
{
|
||||
key: FeatureFlagKey.IS_DATE_TIME_WHOLE_DAY_FILTER_ENABLED,
|
||||
workspaceId: workspaceId,
|
||||
value: true,
|
||||
},
|
||||
{
|
||||
key: FeatureFlagKey.IS_RECORD_PAGE_LAYOUT_EDITING_ENABLED,
|
||||
workspaceId: workspaceId,
|
||||
|
||||
Reference in New Issue
Block a user