From bed5270f3caeaa2062671acb16bb43949258b188 Mon Sep 17 00:00:00 2001 From: Charles Bochet Date: Thu, 11 Dec 2025 00:22:48 +0100 Subject: [PATCH] Message/Calendar thread temporary fix during datasource refactoring (#16480) The current repository implementation require the caller to pass the permissionConfig which is not the case in messaging and calendar custom resolver. We are bypassing the permission as fetching the role in the caller will likely not be needed anymore in the new datasource / orm implementation --- .../core-modules/calendar/timeline-calendar-event.service.ts | 2 ++ .../core-modules/messaging/services/get-messages.service.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/packages/twenty-server/src/engine/core-modules/calendar/timeline-calendar-event.service.ts b/packages/twenty-server/src/engine/core-modules/calendar/timeline-calendar-event.service.ts index 905792f798..7a6355f21f 100644 --- a/packages/twenty-server/src/engine/core-modules/calendar/timeline-calendar-event.service.ts +++ b/packages/twenty-server/src/engine/core-modules/calendar/timeline-calendar-event.service.ts @@ -191,6 +191,7 @@ export class TimelineCalendarEventService { await this.globalWorkspaceOrmManager.getRepository( workspaceId, 'person', + { shouldBypassPermissionChecks: true }, ); const personIds = await personRepository.find({ @@ -246,6 +247,7 @@ export class TimelineCalendarEventService { await this.globalWorkspaceOrmManager.getRepository( workspaceId, 'opportunity', + { shouldBypassPermissionChecks: true }, ); const opportunity = await opportunityRepository.findOne({ diff --git a/packages/twenty-server/src/engine/core-modules/messaging/services/get-messages.service.ts b/packages/twenty-server/src/engine/core-modules/messaging/services/get-messages.service.ts index 3f0bbca6a8..492a329f9b 100644 --- a/packages/twenty-server/src/engine/core-modules/messaging/services/get-messages.service.ts +++ b/packages/twenty-server/src/engine/core-modules/messaging/services/get-messages.service.ts @@ -83,6 +83,7 @@ export class GetMessagesService { await this.globalWorkspaceOrmManager.getRepository( workspaceId, 'person', + { shouldBypassPermissionChecks: true }, ); const personIds = ( await personRepository.find({ @@ -131,6 +132,7 @@ export class GetMessagesService { await this.globalWorkspaceOrmManager.getRepository( workspaceId, 'opportunity', + { shouldBypassPermissionChecks: true }, ); const opportunity = await opportunityRepository.findOne({