Skip to content

Conversation

@Ryukemeister
Copy link
Contributor

@Ryukemeister Ryukemeister commented Jan 7, 2026

Summary by cubic

Fixes rescheduling so org admins can reschedule seated bookings and bookings they manage without ownership errors. Ensures the Booker loads the correct event type by using the booking host’s username during reschedule.

  • Bug Fixes
    • Added org admin ownership check in getBookingForReschedule for seated events.
    • Exposed user.username in booking queries and preferred the host’s username in the Booker when rescheduling.
    • Preserved booking seat data (description and responses) during reschedule.

Written for commit d85c9a8. Summary will update on new commits.

@Ryukemeister Ryukemeister requested review from a team as code owners January 7, 2026 08:58
@graphite-app graphite-app bot added consumer core area: core, team members only labels Jan 7, 2026
@vercel
Copy link

vercel bot commented Jan 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

4 Skipped Deployments
Project Deployment Review Updated (UTC)
api-v2 Ignored Ignored Preview Jan 9, 2026 2:06am
cal Ignored Ignored Jan 9, 2026 2:06am
cal-companion Ignored Ignored Preview Jan 9, 2026 2:06am
cal-eu Ignored Ignored Jan 9, 2026 2:06am

@Ryukemeister
Copy link
Contributor Author

most of these are just linting changes

const isUserIdInBooking = theBooking.userId === userId;

if (!isOwnerOfBooking && !isHostOfEventType && !isUserIdInBooking) return null;
const isOrgAdmin =
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this ensures if an org admin tries to reschedule booking belonging to members of his org we dont throw an error

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should use PBAC here for booking.read or whatever permission you see fit with fallback roles of adminOrOwner.

This ADMIN field this checks in orgs isnt 100% true when PBAC is enabled

user: {
select: {
id: true,
username: true,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for rescheduling its better to use the host username that we get from get-booking

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

const queryClient = useQueryClient();

const username = useMemo(() => {
// when rescheduling, prefer the booking host's username from bookingData
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the only change thats been made in BookerPlatformWrapper

const isUserIdInBooking = theBooking.userId === userId;

if (!isOwnerOfBooking && !isHostOfEventType && !isUserIdInBooking) return null;
const isOrgAdmin =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should use PBAC here for booking.read or whatever permission you see fit with fallback roles of adminOrOwner.

This ADMIN field this checks in orgs isnt 100% true when PBAC is enabled

@github-actions github-actions bot marked this pull request as draft January 7, 2026 09:07
@Ryukemeister
Copy link
Contributor Author

Ryukemeister commented Jan 7, 2026

@sean-brydon this is for a platform customer and platform orgs dont use PBAC. I don't think we let anyone do this on app.cal.com

@sean-brydon
Copy link
Member

@sean-brydon this is for a platform customer and platform orgs dont use PBAC. I don't think we let anyone do this on app.cal.com

They can though right? This is still core logic that should take it into account I think? I don’t belive this is a platform specific file

@Ryukemeister
Copy link
Contributor Author

@sean-brydon this is for a platform customer and platform orgs dont use PBAC. I don't think we let anyone do this on app.cal.com

They can though right? This is still core logic that should take it into account I think? I don’t belive this is a platform specific file

no they cant use PBAC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

consumer core area: core, team members only size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants