Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

🔒️ Fix missing ownership check when setting calendar (#2239)

Luke Vella4bffe26e5934
diff --git a/apps/web/src/features/calendars/mutations.ts b/apps/web/src/features/calendars/mutations.ts
index bf06882cb..81db5f40d 100644
--- a/apps/web/src/features/calendars/mutations.ts
+++ b/apps/web/src/features/calendars/mutations.ts
@@ -185,10 +185,10 @@ export const setCalendarSelection = async (params: {
calendarId: string;
isSelected: boolean;
}) => {
- const { calendarId, isSelected } = params;
+ const { userId, calendarId, isSelected } = params;
const calendar = await prisma.providerCalendar.findFirst({
- where: { id: calendarId },
+ where: { id: calendarId, calendarConnection: { userId } },
});
if (!calendar) {