Skip to main content

Module revisions

Module revisions 

Source
Expand description

Revisions: attributes, check-out/check-in, revise and obsolete.

Structs§

RevisionUpdate

Enums§

Release
How cancel_checkout would treat the actor and the revision’s lock.

Constants§

RELEASE_REASON_MAX
Longest reason for releasing a check-out.
RELEASE_REASON_MIN
Shortest reason for releasing an active member’s check-out.

Functions§

cancel_checkout
Releases the edit lock without uploading anything (“cancel check-out”). Administrators may release locks of other users, managers of the item’s group those of users who are gone: no longer members (who cannot release them themselves once a restricted group hides the revision) or deactivated. A check-in with new file versions is files::check_in; the bulk release for one holder is checkouts::release_held.
check_release_reason
Checks a release reason as cancel_checkout would (400), for callers that release many check-outs with one reason.
checked_out_by
Revisions currently checked out by the actor (only those it may still read: a user who left a restricted group asks a manager of the group or an admin to cancel them, see cancel_checkout).
checkout
Takes the exclusive edit lock of an in-work revision.
ensure_checkout_possible
Fails unless actor could work on rev: project access, revision in work and not checked out by somebody else (the precondition for checking out).
ensure_editable
Fails unless actor may modify rev right now: everything of ensure_checkout_possible and the revision is checked out by the actor. Every change to attributes, files and BOM requires the lock.
ensure_project_access
Fails unless actor may change data of the revision’s project: CAD editor (or admin) and member of the item’s project group. A revision the actor may not even read answers “not found”, so the message below (which names the group) never reaches outsiders of restricted groups.
get
A revision the actor may read; hidden ones answer like missing ones.
get_by_code
A revision of an item by its code (A, B, …), if the actor may read it.
label
Human readable label such as PRT-000042/B.
may_cancel_checkout
For pages: whether cancel_checkout would release the revision’s lock without a reason.
obsolete
Marks a released revision as obsolete.
release_rule
For pages: whether and how cancel_checkout would release the revision’s lock.
revise
Creates the next revision of an item, copying attributes, files and BOM lines from revision id. Only possible when the item has no open revision.
state_of
update
Changes name, description, material, mass, cost and custom attributes of a revision.