platform
platform copied to clipboard
fix(contact): enforce employee contact edit permissions
fix(contact): enforce employee contact edit permissions
Summary
Regular users should be able to maintain their own contact details, but they should not be able to edit another employee's person record or attached communication channels. This change enforces that boundary in both the UI and the server transaction middleware.
Changes
- Allow regular users to edit their own person/contact details and non-employee contacts.
- Reject regular-user CUD transactions that update another employee
Personor channels attached to that employee. - Apply the server-side check to nested
TxApplyIfpayloads so direct transaction bypasses are still blocked. - Reuse a shared contact editability helper in person editing, channel editors, and channel presenters so blocked channel actions are hidden or disabled.
- Add middleware coverage for own-person edits, blocked cross-employee person/channel edits, and maintainer bypass behavior.
Testing
git diff --check upstream/develop..HEADnode common/scripts/install-run-rush.js test -t @hcengineering/middlewarenode common/scripts/install-run-rush.js build -t @hcengineering/middleware -t @hcengineering/contact-resources
Notes
rushx svelte-checkinplugins/contact-resourceswas attempted, but this fresh upstream worktree currently fails on broad dependency/export type errors outside this patch.
Connected to Huly®: UBERF-16480