Skip to content

fix: restore authz filters reverted from #6155#61

Open
devin-ai-integration[bot] wants to merge 1 commit into
eval-bug-1from
devin/1781287434-fix-authz-regression
Open

fix: restore authz filters reverted from #6155#61
devin-ai-integration[bot] wants to merge 1 commit into
eval-bug-1from
devin/1781287434-fix-authz-regression

Conversation

@devin-ai-integration

Copy link
Copy Markdown

Summary

The seed-bug commit reverted the authorization fix from Netflix#6155, introducing three regressions that caused test_sorting_functionality to return empty results:

  1. search_filter_sort_paginate stored the model-specific filter in a separate query_restricted variable and applied it via query.intersect(query_restricted) — but only for Incident/Case models. INTERSECT on an unfiltered restricted query against a filtered query produced empty results when sorting was involved. Fix: apply apply_model_specific_filters directly to query (as the original code did).

  2. restricted_incident_filter / restricted_case_filter lost the admin/owner/manager bypass and switched from outerjoinjoin. The inner join excluded open-visibility incidents/cases that had no participants. Fix: restore the role-based early return and use outerjoin with explicit join conditions.

  3. GET /users/{user_id} lost its OrganizationMemberPermission dependency — restored.

Also removed a stray print() debug statement in apply_filter_specific_joins.

Link to Devin session: https://app.devin.ai/sessions/b25eaa4856404d5e9f02b58fb8ebdd85

- 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>
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants