Skip to main content

set_folder

Function set_folder 

Source
pub async fn set_folder(
    pool: &PgPool,
    actor: &Actor,
    file_id: Uuid,
    folder: &str,
) -> AppResult<FileRecord>
Expand description

Changes the folder of a file (its place in the desktop working folder) while its revision is checked out by the actor.

§Invariants

  • Permission: the file is visible to the actor (“not found” otherwise), its revision is checked out by the actor (409 otherwise) and editable (revisions::ensure_editable: in work, CAD editor of its group).
  • Locks: the revision row (revisions::lock) and the file row (FOR UPDATE).
  • Audit: file.folder, only when the folder actually changes.
  • Notifications / webhooks: none.
  • Atomic: one transaction.