server/crm: separate search actor from account filter - #303
Merged
Conversation
Rename the customer linked-account selector so authenticated actor identity cannot become an implicit organization filter. Cover CLI forwarding, Conat payload routing, and UUID/customer-number/name store searches.
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 changed
account_idtolinked_account_id.account_idthrough public Conat and seed dispatch.--accountmapping.Why
The CRM transport injects the authenticated admin as
account_id. Organization search also interpreted that field as a linked-person account filter, so every ordinary query was silently AND-filtered to organizations linked to the querying admin. Unlinked organizations therefore returned zero results even when UUID, customer number, or display name matched.Risk / impact
--accountfiltering.Validation
pnpm -C src/packages/conat build— passed.pnpm -C src/packages/server build— passed.pnpm -C src/packages/cli build— passed.pnpm -C src/packages/cli test -- src/bin/commands/admin/crm.test.ts— 18/18 passed.git diff --check— clean.Validation limitation:
./workspaces.py version-checkcannot run on currentmainbecause it invokes the absentsrc/scripts/check_npm_packages.py; no dependency versions changed in this PR.Rollback
Revert this commit and redeploy the seed/client pair. This PR has no schema or data migration.
Workbus
No Workbus task ID was provided.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.