-
-
Notifications
You must be signed in to change notification settings - Fork 2
✨ isolate perimeter queries #28
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
WalkthroughThe changes update access control query configuration and logic by renaming the parent query isolation flag, introducing a new flag for perimeter query isolation, and adjusting how perimeters' query callbacks are applied. Test coverage is expanded to verify both parent and perimeter isolation behaviors, and perimeter query callbacks are revised to use strict filtering. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Control
participant ModelQuery
User->>Control: queried(ModelQuery, user)
Control->>Control: Check config for isolate_parent_query
alt Parent query isolation enabled
Control->>ModelQuery: Wrap all perimeter queries in nested where
else
Control->>ModelQuery: Apply perimeter queries directly
end
Control->>Control: For each perimeter
Control->>Control: Check config for isolate_perimeter_queries
alt Perimeter isolation enabled
Control->>ModelQuery: Apply each perimeter query in orWhere closure
else
Control->>ModelQuery: Apply perimeter query directly
end
ModelQuery-->>User: Filtered results
Assessment against linked issues
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (4)
🧰 Additional context used🧬 Code Graph Analysis (2)tests/Support/Access/Controls/ModelControl.php (3)
src/Controls/Control.php (1)
🪛 PHPMD (2.15.0)tests/Feature/ControlsQueryTest.php191-191: Avoid unused parameters such as '$user'. (Unused Code Rules) (UnusedFormalParameter) ⏰ Context from checks skipped due to timeout of 90000ms (1)
🔇 Additional comments (9)
✨ Finishing Touches
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. 🪧 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 (
|
closes #27
closes #26
Summary by CodeRabbit
New Features
Bug Fixes
Tests