feat(knowledge_base): wire client_specific company scoping write path #260

Merged
vas2000-work merged 1 commit from feat/pms-341-kb-company-ids into main 2026-06-16 23:49:24 +02:00
Owner

KB articles could be marked client_specific but company_ids was unsettable at every layer, so the portal read filter ($company = ANY(company_ids)) matched no one and such articles were invisible to all clients.

Add company_ids to CreateKbArticleRequest / UpdateKbArticleRequest and bind it in the insert/update. A client_specific article now requires a non-empty company_ids (422 otherwise); every id is validated as a company owned by the caller's tenant (400 otherwise); any non-client_specific visibility clears the scope so a downgraded article cannot stay portal-visible. KbArticleResponse and the article SELECTs now carry company_ids so the editor can round-trip the selection.

#PMS-341

KB articles could be marked client_specific but company_ids was unsettable at every layer, so the portal read filter ($company = ANY(company_ids)) matched no one and such articles were invisible to all clients. Add company_ids to CreateKbArticleRequest / UpdateKbArticleRequest and bind it in the insert/update. A client_specific article now requires a non-empty company_ids (422 otherwise); every id is validated as a company owned by the caller's tenant (400 otherwise); any non-client_specific visibility clears the scope so a downgraded article cannot stay portal-visible. KbArticleResponse and the article SELECTs now carry company_ids so the editor can round-trip the selection. #PMS-341
feat(knowledge_base): wire client_specific company scoping write path
All checks were successful
Check / fmt + clippy + compile + unit/doc tests (pull_request) Successful in 59s
E2E / Playwright against staging (pull_request) Successful in 1m3s
Integration / integration tests (pull_request) Successful in 5m52s
Create release / Create release from merged PR (pull_request) Has been skipped
82a6912217
KB articles could be marked client_specific but company_ids was unsettable at every layer, so the portal read filter ($company = ANY(company_ids)) matched no one and such articles were invisible to all clients.

Add company_ids to CreateKbArticleRequest / UpdateKbArticleRequest and bind it in the insert/update. A client_specific article now requires a non-empty company_ids (422 otherwise); every id is validated as a company owned by the caller's tenant (400 otherwise); any non-client_specific visibility clears the scope so a downgraded article cannot stay portal-visible. KbArticleResponse and the article SELECTs now carry company_ids so the editor can round-trip the selection.

#PMS-341
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/mokosh-server!260
No description provided.