fix: Org/team admin or owner should be marked as ‘no show’ in a member’s booking (#26009)

* fix: update tempOrgRediret on updating s
lug

* Update packages/trpc/server/routers/viewer/organizations/adminUpdate.handler.ts

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>

* refactor

* fix

* fix

* revert

* fix handle no show

* revert

* Remove metadata from organization query selection

Removed metadata selection from organization query.

* use repo

* update

* Update packages/features/bookings/lib/checkIfUserIsAuthorizedToManageBooking.ts

Co-authored-by: Syed Ali Shahbaz <[email protected]>

* update

---------

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Co-authored-by: Syed Ali Shahbaz <[email protected]>
This commit is contained in:
authored and GitHub committed 2025-12-22 15:42:20 -03:00
1 parent 33eee8dfc3
commit 23920fe9ce
3 files changed
+38 -88

No files matched your search

+8 -2
View File
@@ -1,6 +1,7 @@
import { type TFunction } from "i18next";
import { BookingRepository } from "@calcom/features/bookings/repositories/BookingRepository";
import { BookingAccessService } from "@calcom/features/bookings/services/BookingAccessService";
import { CreditService } from "@calcom/features/ee/billing/credit-service";
import { getBookerBaseUrl } from "@calcom/features/ee/organizations/lib/getBookerUrlServer";
import { workflowSelect } from "@calcom/features/ee/workflows/lib/getAllWorkflows";
@@ -423,9 +424,14 @@ const assertCanAccessBooking = async (bookingUid: string, userId?: number) => {
if (!userId) throw new HttpError({ statusCode: 401 });
const bookingRepo = new BookingRepository(prisma);
const booking = await bookingRepo.findBookingByUidAndUserId({ bookingUid, userId });
const booking = await bookingRepo.findByUidIncludeEventTypeAndReferences({ bookingUid });
const bookingAccessService = new BookingAccessService(prisma);
const isAuthorized = await bookingAccessService.doesUserIdHaveAccessToBooking({
userId,
bookingUid,
});
if (!booking)
if (!isAuthorized)
throw new HttpError({ statusCode: 403, message: "You are not allowed to access this booking" });
const isUpcoming = new Date(booking.endTime) >= new Date();