Fixes a cross-admin conversation bug where users could post conversations to targets outside of their own organization.#1814
Merged
Conversation
…the /conversation/target/uuid endpoint
cberger8
approved these changes
May 20, 2026
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
This PR restricts conversation creation such that non-Secretariat users (such as Org Admins) can only post conversations directed to their own organization's UUID. If a non-Secretariat user attempts to target a UUID that does not match their org's UUID, the request is immediately rejected with a
403 Forbiddenresponse.Important Changes
src/controller/conversation.controller/conversation.controller.jscreateConversationForTargetUUIDfor non-Secretariat users to ensuretargetUUIDmatches the user'sorgUUID.403with anUNAUTHORIZEDerror if the UUIDs do not match.test/integration-tests/conversation/conversationTest.jsShould fail to post a conversation to a different org as a non-Secretariat Admin) to ensure unauthorized conversation creation attempts are blocked correctly.Testing
Steps to manually test updated functionality, if possible
win_5_admin@win_5.com).GET /api/registry/org/{short_name}.POST /api/conversation/target/{random_uuid}) using a UUID other than your org's UUID. Verify you receive a403 Forbiddenwith anUNAUTHORIZEDerror payload.POST /api/conversation/target/{org_uuid}) using your actual org's UUID. Verify the request is successful.npm run test:integration -- test/integration-tests/conversation/conversationTest.js).Notes
orgRepo.getOrgUUID(req.ctx.org)functionality to resolve the requestor's organization UUID efficiently without creating new custom error functions.