feat: add availability and ooo permissions to PBAC registry#24081
feat: add availability and ooo permissions to PBAC registry#24081eunjae-lee merged 3 commits intomainfrom
Conversation
- Add Availability and OutOfOffice resources to Resource enum - Add CRUD permissions for both resources with empty scope arrays - Create migration to seed admin_role with all CRUD permissions - Create migration to seed member_role with read-only permissions Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
WalkthroughThis change introduces two new PBAC resources: Availability and OutOfOffice. It adds corresponding CRUD permission entries to PERMISSION_REGISTRY, including i18n keys, categories, scopes, and dependsOn references. The Resource enum gains Availability and OutOfOffice. English locale strings are added for the resources and each CRUD description. A Prisma migration seeds default RolePermission rows: admin_role receives create/read/update/delete for both resources; member_role receives read for both. An inline ESLint comment is added without altering behavior. Possibly related PRs
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (3)
🧰 Additional context used📓 Path-based instructions (3)**/*.ts📄 CodeRabbit inference engine (.cursor/rules/review.mdc)
Files:
**/*.{ts,tsx}📄 CodeRabbit inference engine (.cursor/rules/review.mdc)
Files:
**/*.{ts,tsx,js,jsx}⚙️ CodeRabbit configuration file
Files:
⏰ Context from checks skipped due to timeout of 180000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
- Add pbac_resource_availability and pbac_resource_out_of_office resource names - Add description entries for all CRUD operations on both resources - Follow existing PBAC i18n pattern for consistency Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
E2E results are ready! |
What does this PR do?
This PR adds new
availabilityandooo(Out of Office) permissions to the PBAC (Permission-Based Access Control) system registry and creates a database migration to seed these permissions for the default roles.Changes:
AvailabilityandOutOfOfficeresources to the permission registry with full CRUD operationsadmin_rolewith all CRUD permissions andmember_rolewith read-only permissions for both resourcesLink to Devin run: https://app.devin.ai/sessions/fce187a8677f429e8489d2de5520aa94
Requested by: @eunjae-lee
How should this be tested?
Database Migration Testing:
yarn workspace @calcom/prisma db-migrateRolePermissiontable contains the new entries:admin_rolehas create/read/update/delete permissions for both resourcesmember_rolehas only read permissions for both resourcesPermission Registry Testing:
Environment variables: Standard Cal.com database setup required
Important Review Notes
scope: []as specifically requested - verify this is intentional"ooo"as resource key vsOutOfOfficeenum name - confirm this follows existing patternsON CONFLICT DO NOTHINGfor safe re-runs, but verify SQL syntax and logici18nKeyanddescriptionI18nKeyvalues in permission registry have matching entries incommon.jsonMandatory Tasks (DO NOT REMOVE)
Checklist