-
Notifications
You must be signed in to change notification settings - Fork 1.3k
feat(core): Expand userHasPermissions docstring; Add new userHasAllPermissions method #4107
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
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughAdded OR-style permission checking behavior clarification and an explicit AND-style check to RequestContext: the existing userHasPermissions now checks if the user has at least one of the specified permissions (OR), and a new userHasAllPermissions method requires all specified permissions (AND). Tests were added to cover both behaviors, including scenarios with no session, missing channel permissions, and mixed permission sets. Documentation comments on the Allow decorator were updated to reflect OR semantics when multiple permissions are provided. Changes
Estimated code review effort🎯 Medium | ⏱️ ~30 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (1)
🧰 Additional context used🧬 Code graph analysis (1)packages/core/src/api/common/request-context.ts (1)
🪛 Gitleaks (8.30.0)packages/core/src/api/common/request-context.spec.ts[high] 265-265: Detected a Generic API Key, potentially exposing access to various services and sensitive operations. (generic-api-key) ⏰ 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). (17)
🔇 Additional comments (8)
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 |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
40a3dd6 to
a4d74d7
Compare
|



Description
The AND/OR logic of the permissions may sometimes be misleading. This PR aims to clarify some of the confusion and adds a new method that uses ALL logic.
Breaking changes
None
Checklist
📌 Always:
👍 Most of the time: