fix: get bookings handler for pbac and fallback roles#25434
Merged
sean-brydon merged 29 commits intomainfrom Jan 16, 2026
Merged
fix: get bookings handler for pbac and fallback roles#25434sean-brydon merged 29 commits intomainfrom
sean-brydon merged 29 commits intomainfrom
Conversation
CarinaWolli
previously approved these changes
Nov 28, 2025
emrysal
previously approved these changes
Nov 28, 2025
Contributor
emrysal
left a comment
There was a problem hiding this comment.
Still needs some work elsewhere in this file, but good work on implementing PBAC!
Contributor
E2E results are ready! |
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
eunjae-lee
reviewed
Dec 1, 2025
| return eventTypeIdsFromDb; | ||
| } | ||
|
|
||
| async function getEventTypeIdsWhereUserIsAdminOrOwner( |
Contributor
There was a problem hiding this comment.
i like this deletion 🔥 no more need for custom logic to check resource authorization
eunjae-lee
previously approved these changes
Dec 1, 2025
Contributor
|
This PR has been marked as stale due to inactivity. If you're still working on it or need any help, please let us know or update the PR to keep it active. |
hbjORbj
reviewed
Jan 7, 2026
Contributor
hbjORbj
left a comment
There was a problem hiding this comment.
Can you fix the failing tests? 🙏
Contributor
|
This PR has been marked as stale due to inactivity. If you're still working on it or need any help, please let us know or update the PR to keep it active. |
…row function Co-Authored-By: sean@cal.com <Sean@brydon.io>
Co-Authored-By: sean@cal.com <Sean@brydon.io>
Co-Authored-By: sean@cal.com <Sean@brydon.io>
volnei
approved these changes
Jan 16, 2026
This was referenced Jan 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This PR is stacked upon #25387
Fixes the issue where PBAC/fallback roles were not taken into consideration correctly when calling get booking. The changes include:
get.handler.tsto usePermissionCheckServiceinstead of direct membership queriesorgIdparameter togetTeamIdsWithPermissionandgetTeamIdsWithPermissionsto properly scope results to the user's organizationPermissionRepositoryto filter teams by organization scopeorgIdfiltering functionalityUpdates since last revision
PermissionCheckServicemock to usefunction()instead of arrow function (required for proper constructor mocking in Vitest)scopedOrgIdparameter toorgIdfor consistencyMembershipRoleenum instead of hardcoded stringsVisual Demo (For contributors especially)
N/A - Backend logic changes only
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
TZ=UTC yarn vitest run packages/trpc/server/routers/viewer/bookings/get.handler.test.tsVITEST_MODE=integration yarn test packages/features/pbac/infrastructure/repositories/__tests__/PermissionRepository.integration-test.tsHuman Review Checklist
PermissionRepository.tscorrectly handle theorgIdfiltering (including null/undefined cases)function()instead of arrow function is the correct patternLink to Devin run: https://app.devin.ai/sessions/8454efaba8ea4ecdb672f6ec9bde2876
Requested by: sean@cal.com (@sean-brydon)