-
Notifications
You must be signed in to change notification settings - Fork 11.6k
fix: remove fallback permssions on organization Id. #22769
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
Conversation
WalkthroughThis change introduces a new "manage" permission action across the application’s permission system. The Estimated code review effort🎯 3 (Moderate) | ⏱️ ~15–20 minutes
Possibly related PRs
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🧰 Additional context used📓 Path-based instructions (1)**/*.{js,jsx,ts,tsx}📄 CodeRabbit Inference Engine (.cursor/rules/review.mdc)
Files:
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (3)
✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Graphite Automations"Add consumer team as reviewer" took an action on this PR • (07/28/25)1 reviewer was added to this PR based on Keith Williams's automation. "Add ready-for-e2e label" took an action on this PR • (07/28/25)1 label was added to this PR based on Keith Williams's automation. |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ |
emrysal
left a comment
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.
Looks good, lgtm
This reverts commit 30061c0. Removes the manage permission concept and fallback logic to simplify permission checking back to direct role-based checks.
#23013) * Revert "fix: remove fallback permssions on organization Id. (#22769)" This reverts commit 30061c0. Removes the manage permission concept and fallback logic to simplify permission checking back to direct role-based checks. * remove manage from workflows * fix type error and remove manage from components
What We Did
I provided a comprehensive PR Summary for implementing PBAC
(Permission-Based Access Control) "manage" permissions in the
Cal.com codebase. This was a detailed documentation of a
completed feature implementation.
Key Implementation Details Covered
Database & Schema Changes
• Migration file:
packages/prisma/migrations/20250728091301_add_manage_permissions_to_default_roles/migration.
sql
• Added 4 new "manage" permissions to admin roles for: roles,
event types, teams, and bookings
Core Logic Files Modified
• Permission Registry:
packages/features/pbac/domain/types/permission-registry.ts
• Added Manage = "manage" to CrudAction enum
• Defined organization-scoped manage permissions
• Permission Service:
packages/features/pbac/services/permission-check.service.ts
• Enhanced 3 key methods: getResourcePermissions(),
hasPermission(), hasPermissions()
• Implemented automatic permission expansion and hierarchical
fallback logic
Testing & Localization
• Test file:
packages/features/pbac/services/tests/permission-check.
service.test.ts (6 new test cases, 30 total passing)
• i18n file: apps/web/public/static/locales/en/common.json (79
PBAC strings added)
Current Status
• Complete feature implementation with manage permissions
allowing organization administrators to have hierarchical
control over all actions within specific resources
• All tests passing, migration applied, comprehensive
documentation provided
What We're Working On
This appears to be a completed feature summary/documentation
rather than active development work.