Skip to main content

set_item_owner

Function set_item_owner 

Source
pub async fn set_item_owner(
    pool: &PgPool,
    actor: &Actor,
    item_id: Uuid,
    new_owner: Uuid,
) -> AppResult<Item>
Expand description

Changes the owner of an item.

§Invariants

  • Permission: administrator, or a manager of the item’s project group (403); the actor must be able to read the item (404). Items without a group are for administrators only.
  • Data: the new owner is active, a CAD editor or administrator and may read the item (400).
  • Locks: the item row (FOR UPDATE).
  • Audit: item.owner, related to the item.
  • Notifications / webhooks: none.
  • Atomic: one transaction.