-
Notifications
You must be signed in to change notification settings - Fork 11.5k
fix: Booker reschedule behaviour for org admin #26530
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
most of these are just linting changes |
| const isUserIdInBooking = theBooking.userId === userId; | ||
|
|
||
| if (!isOwnerOfBooking && !isHostOfEventType && !isUserIdInBooking) return null; | ||
| const isOrgAdmin = |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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
There was a problem hiding this 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 |
There was a problem hiding this comment.
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 = |
There was a problem hiding this comment.
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
|
@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 |
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.
Written for commit d85c9a8. Summary will update on new commits.