SecurityApi.unlockOwnerPermissions()
Unlocks a document opened with the user password. Once accepted, everything is allowed: the viewer follows the unlock at once, and the unlock outlives every later reload (an edit, an undo). Needs no feature.
methodProtectionsince 1.0.0
Signature
unlockOwnerPermissions(ownerPassword: string): Promise<boolean>
Parameters
| Parameter | Type | Description |
|---|---|---|
| ownerPassword | string | The document's owner password. |
Returns
Promise<boolean> Whether the password was accepted.
Throws
DOCUMENT_CLOSED— the document has been closed.
Example
TypeScript
const unlocked = await doc.security.unlockOwnerPermissions(ownerPassword); if (!unlocked) showError('Wrong owner password');