method

App.AcquireDocumentLock

func (application *App) AcquireDocumentLock( ctx context.Context, collection, documentID string, takeover bool, identity *AuthIdentity, ) (DocumentLockState, error)

Acquire, refresh, or explicitly take over an authoring lock.

Source core/locks.go:48

@param ctx
The ctx value.
@param collection
The collection value.
@param documentID
The documentID value.
@param takeover
The takeover value.
@param identity
The identity value.
@returns
The declared result.

Takeover uses CollectionAccess.Unlock, falling back to Update when omitted. Locks coordinate editors; they do not replace optimistic revision checks or authorization.

Related types

  • App

    A resolved application bound to operation services.

  • AuthIdentity

    An exact authenticated collection and actor document.

  • DocumentLockState

    Safe current lock metadata and actor capabilities.