platform icon indicating copy to clipboard operation
platform copied to clipboard

fix(contact): enforce employee contact edit permissions

Open ignatremizov opened this issue 6 months ago • 1 comments

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 Person or channels attached to that employee.
  • Apply the server-side check to nested TxApplyIf payloads 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..HEAD
  • node common/scripts/install-run-rush.js test -t @hcengineering/middleware
  • node common/scripts/install-run-rush.js build -t @hcengineering/middleware -t @hcengineering/contact-resources

Notes

  • rushx svelte-check in plugins/contact-resources was attempted, but this fresh upstream worktree currently fails on broad dependency/export type errors outside this patch.

ignatremizov avatar May 25 '26 18:05 ignatremizov

Connected to Huly®: UBERF-16480

huly-github-staging avatar May 25 '26 18:05 huly-github-staging