Repository navigation
Conversation
show and generate looked the case up by number within the org, so any volunteer could download the stored report of a case they were not assigned to, and a formerly assigned volunteer could regenerate it. Resolve the case through policy_scope(CasaCase) so volunteers only reach actively assigned cases, and 'not yours' answers exactly like 'not found'. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
compwron
force-pushed
the
fix/court-report-case-scope
branch
from
November 16, 2026 09:01
31de5d7 to
cd55bcd
Compare
This branch has not been deployed
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.
What
CaseCourtReportsController#showand#generatenow resolve the case throughpolicy_scope(CasaCase): admins and supervisors get their org's cases, volunteers get only cases they are actively assigned to. A case that is not yours answers exactly like one that does not exist (same redirect / same 404 JSON), and a volunteer who was unassigned can no longer regenerate that case's latest report.Tests
New request specs for unassigned and deactivated volunteers, same-org supervisor (still allowed), other-org supervisor, and identical responses for not-yours vs. unknown. 4 of them fail without the fix.
spec/requests/case_court_reports_spec.rb: 37 examples, 0 failures.🤖 Generated with Claude Code