Skip to content

The open alternative to Salesforce, designed for AI.

Message/Calendar thread temporary fix during datasource refactoring (#16480)

Charles Bochetbed5270f3cae
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 905792f798e..7a6355f21f0 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<PersonWorkspaceEntity>(
workspaceId,
'person',
+ { shouldBypassPermissionChecks: true },
);
const personIds = await personRepository.find({
@@ -246,6 +247,7 @@ export class TimelineCalendarEventService {
await this.globalWorkspaceOrmManager.getRepository<OpportunityWorkspaceEntity>(
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 3f0bbca6a86..492a329f9b3 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<PersonWorkspaceEntity>(
workspaceId,
'person',
+ { shouldBypassPermissionChecks: true },
);
const personIds = (
await personRepository.find({
@@ -131,6 +132,7 @@ export class GetMessagesService {
await this.globalWorkspaceOrmManager.getRepository<OpportunityWorkspaceEntity>(
workspaceId,
'opportunity',
+ { shouldBypassPermissionChecks: true },
);
const opportunity = await opportunityRepository.findOne({