Repository navigation
Conversation
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
force-pushed
the
fix/case-assignment-org-scope
branch
from
November 16, 2026 09:01
82ff6ad to
331c172
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
CaseAssignmentsController#createlooked the volunteer up with an unscopedUser.findand 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 withincurrent_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