Skip to content

YjsACL

Defined in: yjs/src/peerborne-yjs.ts:1435

  • ACL<Uint8Array, CryptoKey>

new YjsACL(): YjsACL

YjsACL

readonly actorBinding: ACLActorBinding<Uint8Array<ArrayBufferLike>>

Defined in: yjs/src/peerborne-yjs.ts:1458

Client IDs are 53-bit values derived from the signer and an instance nonce.

ACL.actorBinding

add(publicKey): Promise<Uint8Array<ArrayBufferLike>>

Defined in: yjs/src/peerborne-yjs.ts:1624

Add a new user to the ACL.

CryptoKey

User’s public key.

Promise<Uint8Array<ArrayBufferLike>>

A block of change(s) for the addition to the ACL.

ACL.add


check(publicKey): Promise<boolean>

Defined in: yjs/src/peerborne-yjs.ts:1807

Checks to see if the specified user has a specific capability. If capability is undefined, checks if the user is in the ACL at all.

CryptoKey

User’s public key.

Promise<boolean>

true if the user has the specified capability (or is in the ACL if no capability specified).

ACL.check


current(): Uint8Array

Defined in: yjs/src/peerborne-yjs.ts:1737

Gets a block of change(s) describing the current state of the ACL.

Uint8Array

A block of change(s) describing the whole ACL.

ACL.current


merge(change): boolean

Defined in: yjs/src/peerborne-yjs.ts:1741

Applies a block of change(s) to the ACL.

A thrown ACLOperationInProgressError certifies that the merge was rejected at its pre-mutation admission boundary and can be retried after settlement. A thrown ACLMergeRejectedError certifies that the merge was rejected without changing the ACL and must not be retried with the same changes. A thrown ACLMergeDependencyError certifies that the changes depend on history the ACL does not hold yet and were not applied; implementations must never let the live ACL depend on missing history. Generic callers cannot assume any other exception left a custom implementation unchanged, so authorization-sensitive orchestration must fail closed.

Uint8Array

boolean

false when the merge left the ACL state unchanged, for example because the block was already merged. An implementation that cannot tell may return nothing, and callers then treat the merge as a change.

ACL.merge


prepareAdd(publicKey): Promise<PreparedACLChange<Uint8Array<ArrayBufferLike>>>

Defined in: yjs/src/peerborne-yjs.ts:1628

Stage a user addition without mutating the live ACL.

Callers can finish fallible publication work before invoking the synchronous commit. Implementations MUST detach changes from both the caller and the private staged state and reject a repeated or stale commit before mutation. A successful commit MUST apply the staged state completely. Generic callers MUST treat any other commit exception as an indeterminate backing state and fail closed; they cannot assume a custom implementation rolled back a partially applied commit. The shipped CRDT adapters complete fallible work during preparation and atomically swap their private staged state only after all commit checks pass.

CryptoKey

Promise<PreparedACLChange<Uint8Array<ArrayBufferLike>>>

ACL.prepareAdd


prepareRemove(publicKey): Promise<PreparedACLChange<Uint8Array<ArrayBufferLike>>>

Defined in: yjs/src/peerborne-yjs.ts:1636

Stage a user removal without mutating the live ACL.

Callers can finish fallible publication work before invoking the synchronous commit. Implementations MUST detach changes from both the caller and the private staged state and reject a repeated or stale commit before mutation. A successful commit MUST apply the staged state completely. Generic callers MUST treat any other commit exception as an indeterminate backing state and fail closed; they cannot assume a custom implementation rolled back a partially applied commit. The shipped CRDT adapters complete fallible work during preparation and atomically swap their private staged state only after all commit checks pass.

CryptoKey

Promise<PreparedACLChange<Uint8Array<ArrayBufferLike>>>

ACL.prepareRemove


remove(publicKey): Promise<Uint8Array<ArrayBufferLike>>

Defined in: yjs/src/peerborne-yjs.ts:1632

Remove a user from the ACL.

CryptoKey

User’s public key.

Promise<Uint8Array<ArrayBufferLike>>

A block of change(s) for the removal from the ACL.

ACL.remove


users(): Promise<CryptoKey[]>

Defined in: yjs/src/peerborne-yjs.ts:1813

Returns the list of users with a specific capability. If capability is undefined, returns all users.

Promise<CryptoKey[]>

ACL.users