Fixes #39394 - Handle empty taxonomy scopes in authorizer - #11172
Open
jakduch wants to merge 1 commit into
Open
Conversation
Assisted-By: Codex 5.6 Sol High
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
Non-admin users with only an organization or only a location assigned could receive a 500 response when listing taxable resources.
An empty taxonomy intersection was represented as a contradictory Scoped Search expression using
set?andnull?. Unlike regular has-many conditions, Scoped Search does not wrap these operators in a subquery, leaving a direct reference to thetaxonomiestable after the eager-loads were removed in #39209.Represent empty taxonomy intersections as no access and let the authorizer add an explicit false SQL condition. Filters without an overlapping taxonomy are skipped individually in the non-granular path.
This preserves the duplicate-result fix from #39209 without restoring the removed taxonomy eager-loads.
Testing
AI usage disclosure
Per the community discussion on AI policy, the issue was investigated and the changes, tests, and PR wording were prepared with the assistance of Codex 5.6 Sol High. The resulting changes were reviewed before submitting. The commit also includes an
Assisted-Bytrailer.