Skip to content

Keep contact types and topics inside the admin's own org - #7407

Open
compwron wants to merge 1 commit into
mainfrom
fix/contact-type-topic-org-scope
Open

compwron wants to merge 1 commit into
mainfrom
fix/contact-type-topic-org-scope

Conversation

@compwron

Copy link
Copy Markdown
Collaborator

What

  • Contact types: contact_type_group_id is now looked up within current_organization on create and update (404 for another org's group).
  • Contact topics: casa_org_id is no longer a permitted param. New topics take the creator's org; existing topics cannot be moved. The hidden casa_org_id field is removed from the form.

Tests

New request specs for foreign groups, foreign contact types and topics, and a submitted casa_org_id. 4 fail without the fix. The old 'invalid parameters' topic spec used casa_org_id: 0 as its invalid input, so it now uses a blank question. Contact type/topic request specs plus spec/system/contact_types and spec/system/casa_org: 45 examples, 0 failures.

🤖 Generated with Claude Code

@github-actions github-actions Bot added 🧪 Tests Tests ruby Touches Ruby code erb Touches ERB templates labels Nov 16, 2026
Contact types accepted any contact_type_group_id and topics accepted
casa_org_id, so an admin could create or move records into another org
(and, for topics, into that org's court reports). Look the group up within
current_organization, and take a topic's org from the creator, never from
params.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@compwron
compwron force-pushed the fix/contact-type-topic-org-scope branch from b59788f to 07e3b21 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

erb Touches ERB templates ruby Touches Ruby code 🧪 Tests Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant