method

App.AcquireDocumentLock

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

Arguments

ArgumentTypeDescription
ctxcontext.ContextThe ctx value.
collectionstringThe collection value.
documentIDstringThe documentID value.
takeoverboolThe takeover value.
identity*AuthIdentityThe identity value.

Returns

The declared result.

(DocumentLockState, error)

How it works

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

Full signature

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

Source core/locks.go:48

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.