[CORRUPTED] Synthetic Benchmark PR #26871 - refactor: migrate MembershipRole usages to PBAC permission checks#566
Open
ofir-frd wants to merge 1 commit intobase_pr_26871_20260120_2393from
Conversation
|
Hey there and thank you for opening this pull request! 👋🏼 We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted. Details: |
|
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. |
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.
Benchmark PR calcom#26871
Type: Corrupted (contains bugs)
Original PR Title: refactor: migrate MembershipRole usages to PBAC permission checks
Original PR Description: ## What does this PR do?
Refactors direct
MembershipRolechecks throughout the codebase to use the PBAC (Permission-Based Access Control) system viaPermissionCheckService. This is part of the ongoing effort to centralize permission logic and enable fine-grained access control.Changes include:
get.handler.ts: RenamedisTeamAdminOrOwner→canUpdateTeamsusing PBACcheckForInvalidAppCredentials.ts: UsesgetTeamIdsWithPermissionfor team credential accessoutOfOffice.utils.ts: Usesooo.updatepermission for admin checkscheckIfOrgNeedsUpgrade.handler.ts: Usesorganization.manageBillingpermissiongetActiveOnOptions.handler.ts: Pre-fetches teams witheventType.updatepermissionWorkflowRepository.ts: Usesworkflow.updatepermission for readOnly determinationorganization.tsx: Usesorganization.updatepermission for org management accessgetEventTypesByViewer.ts: UseseventType.updatefor managed event type filteringgetPublicEvent.ts: Usesteam.readpermission for private team member visibilityUpdates since last revision
teamsWithEventTypeManagePermission→teamsWithEventTypeUpdatePermissionandcanManageEventTypes→canUpdateEventTypesto align with theeventType.updatepermission being checkedLink to Devin run: https://app.devin.ai/sessions/b006afc07b43408e9ecd92da851aaff2
Requested by: @sean-brydon
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
API Response Change: The
/api/trpc/viewer.meendpoint now returnscanUpdateTeamsinstead ofisTeamAdminOrOwner. Verify this doesn't break any frontend functionality.Permission Checks: Test the following scenarios with both PBAC enabled and disabled (fallback mode):
Fallback Behavior: When PBAC is not enabled for a team, the
fallbackRolesshould maintain the same behavior as the previous direct role checks.Checklist
Items for Human Review
isTeamAdminOrOwnerrenamed tocanUpdateTeamsin me endpoint - verify no other consumers depend on old nameteam.readis the correct permission for private team member visibility (vsteam.listMembersPrivate)Original PR URL: refactor: migrate MembershipRole usages to PBAC permission checks calcom/cal.com#26871
Compliance Violation