From 589a0c7b2d7b729dbf94a7ec8e2a95d3d54fed09 Mon Sep 17 00:00:00 2001 From: Weiko Date: Tue, 25 Feb 2025 15:46:06 +0100 Subject: [PATCH] Fix graphql conflict between role custom object and role dto (#10479) ## Context Following the strategy where we want to block custom object creation when the type is reserved by core objects. The issue happened again with the recently introduced role table. --- .../validate-object-metadata-input.util.ts | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/packages/twenty-server/src/engine/metadata-modules/object-metadata/utils/validate-object-metadata-input.util.ts b/packages/twenty-server/src/engine/metadata-modules/object-metadata/utils/validate-object-metadata-input.util.ts index d22281cf5..00e7246ea 100644 --- a/packages/twenty-server/src/engine/metadata-modules/object-metadata/utils/validate-object-metadata-input.util.ts +++ b/packages/twenty-server/src/engine/metadata-modules/object-metadata/utils/validate-object-metadata-input.util.ts @@ -12,18 +12,41 @@ import { validateMetadataNameValidityOrThrow } from 'src/engine/metadata-modules import { camelCase } from 'src/utils/camel-case'; const coreObjectNames = [ + 'approvedAccessDomain', + 'approvedAccessDomains', 'appToken', + 'appTokens', + 'billingCustomer', + 'billingCustomers', + 'billingEntitlement', + 'billingEntitlements', + 'billingMeter', + 'billingMeters', + 'billingProduct', + 'billingProducts', 'billingSubscription', 'billingSubscriptions', 'billingSubscriptionItem', 'billingSubscriptionItems', 'featureFlag', + 'featureFlags', + 'keyValuePair', + 'keyValuePairs', + 'postgresCredential', + 'postgresCredentials', + 'twoFactorMethod', + 'twoFactorMethods', 'user', 'users', 'userWorkspace', 'userWorkspaces', 'workspace', 'workspaces', + + 'role', + 'roles', + 'userWorkspaceRole', + 'userWorkspaceRoles', ]; const reservedKeywords = [