fix: restore authz filters reverted from #6155#61
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
fix: restore authz filters reverted from #6155#61devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
- Restore admin/owner/manager role bypass in restricted_incident_filter
and restricted_case_filter (default-deny for non-privileged roles)
- Switch from inner join to outerjoin so open-visibility incidents/cases
without participants still appear in query results
- Apply model-specific filters directly to the query instead of using
intersect, which broke sorting and produced empty results
- Re-add OrganizationMemberPermission to GET /users/{user_id}
- Remove debug print in apply_filter_specific_joins
Co-Authored-By: bot_apk <apk@cognition.ai>
Author
🤖 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:
|
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.
Summary
The seed-bug commit reverted the authorization fix from Netflix#6155, introducing three regressions that caused
test_sorting_functionalityto return empty results:search_filter_sort_paginatestored the model-specific filter in a separatequery_restrictedvariable and applied it viaquery.intersect(query_restricted)— but only for Incident/Case models.INTERSECTon an unfiltered restricted query against a filtered query produced empty results when sorting was involved. Fix: applyapply_model_specific_filtersdirectly toquery(as the original code did).restricted_incident_filter/restricted_case_filterlost the admin/owner/manager bypass and switched fromouterjoin→join. The inner join excluded open-visibility incidents/cases that had no participants. Fix: restore the role-based early return and useouterjoinwith explicit join conditions.GET /users/{user_id}lost itsOrganizationMemberPermissiondependency — restored.Also removed a stray
print()debug statement inapply_filter_specific_joins.Link to Devin session: https://app.devin.ai/sessions/b25eaa4856404d5e9f02b58fb8ebdd85