Skip to content

Scope case assignment creation to the requester's organization - #7406

Open
compwron wants to merge 1 commit into
mainfrom
fix/case-assignment-org-scope
Open

compwron wants to merge 1 commit into
mainfrom
fix/case-assignment-org-scope

Conversation

@compwron

Copy link
Copy Markdown
Collaborator

What

CaseAssignmentsController#create looked the volunteer up with an unscoped User.find and did not check the case against the requester's org; the model only checks that the case and volunteer share an org with each other. The volunteer and the case are now both looked up within current_organization (404 otherwise), for new assignments and for reactivating inactive ones.

Tests

New request specs for admin and supervisor requesters with another org's volunteer/case, via both the volunteer and case routes, including reactivation. 3 fail without the fix. spec/requests/case_assignments_spec.rb: 49 examples, 0 failures.

🤖 Generated with Claude Code

@github-actions github-actions Bot added 🧪 Tests Tests ruby Touches Ruby code labels Nov 16, 2026
create looked the volunteer up with an unscoped User.find and never checked
the case against the requester's org, so an admin or supervisor in one org
could assign or reactivate a volunteer of another org on that org's case.
Look the volunteer and the case up within current_organization.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@compwron
compwron force-pushed the fix/case-assignment-org-scope branch from 82ff6ad to 331c172 Compare November 16, 2026 09:01

This branch has not been deployed

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

Labels

ruby Touches Ruby code 🧪 Tests Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant