All problems

A Different Operator Can Acknowledge a Shift Handover

Level 2 · node · Security · Missing assigned-operator check during handover acknowledgment

Scenario

A fictional equipment shift service assigns each handover item to a specific operator. Only that operator may acknowledge the item, but the current endpoint checks only whether the item is still unacknowledged. Any other operator who knows the item ID can acknowledge it. Trace the repository, service, and controller to restore the authorization rule.

Requirements

Change the acknowledgment state only when the requesting operator ID exactly matches the item's assigned operator. Unauthorized requests must throw and leave the stored item unchanged. Preserve duplicate-acknowledgment protection, unknown-item errors, and isolation of other items. Do not add external packages.

Acceptance criteria

  • The assigned operator can acknowledge their pending handover item.
  • A different operator cannot acknowledge an item assigned to someone else.
  • A rejected acknowledgment does not modify the stored item.
  • An already acknowledged item cannot be acknowledged again.
  • Acknowledging an unknown item raises an error.
  • Acknowledging one item does not change another item's state.