Skip to main content

checkout

Function checkout 

Source
pub async fn checkout(
    pool: &PgPool,
    actor: &Actor,
    id: Uuid,
) -> AppResult<Revision>
Expand description

Takes the exclusive edit lock of an in-work revision.

§Invariants

  • Permission: CAD editor; the revision is visible (“not found” otherwise), in a group the actor may edit (403), in work and not checked out by someone else (409).
  • Locks: the revision row (revisions::lock); two check-outs at once give one winner and a 409.
  • Audit: revision.checkout; nothing when the actor already holds the check-out.
  • Notifications / webhooks: none.
  • Atomic: one transaction.