YjsACL
Defined in: yjs/src/peerborne-yjs.ts:710
Implements
Section titled “Implements”ACL<Uint8Array,CryptoKey>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new YjsACL():
YjsACL
Returns
Section titled “Returns”YjsACL
Methods
Section titled “Methods”add(
publicKey):Promise<Uint8Array<ArrayBufferLike>>
Defined in: yjs/src/peerborne-yjs.ts:830
Add a new user to the ACL.
Parameters
Section titled “Parameters”publicKey
Section titled “publicKey”CryptoKey
User’s public key.
Returns
Section titled “Returns”Promise<Uint8Array<ArrayBufferLike>>
A block of change(s) for the addition to the ACL.
Implementation of
Section titled “Implementation of”ACL.add
check()
Section titled “check()”check(
publicKey):Promise<boolean>
Defined in: yjs/src/peerborne-yjs.ts:1047
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.
Parameters
Section titled “Parameters”publicKey
Section titled “publicKey”CryptoKey
User’s public key.
Returns
Section titled “Returns”Promise<boolean>
true if the user has the specified capability (or is in the ACL if no capability specified).
Implementation of
Section titled “Implementation of”ACL.check
current()
Section titled “current()”current():
Uint8Array
Defined in: yjs/src/peerborne-yjs.ts:989
Gets a block of change(s) describing the current state of the ACL.
Returns
Section titled “Returns”Uint8Array
A block of change(s) describing the whole ACL.
Implementation of
Section titled “Implementation of”ACL.current
merge()
Section titled “merge()”merge(
change):boolean
Defined in: yjs/src/peerborne-yjs.ts:993
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. Generic callers cannot assume any other exception left a custom implementation unchanged, so authorization-sensitive orchestration must fail closed.
Parameters
Section titled “Parameters”change
Section titled “change”Uint8Array
Returns
Section titled “Returns”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.
Implementation of
Section titled “Implementation of”ACL.merge
prepareAdd()
Section titled “prepareAdd()”prepareAdd(
publicKey):Promise<PreparedACLChange<Uint8Array<ArrayBufferLike>>>
Defined in: yjs/src/peerborne-yjs.ts:837
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.
Parameters
Section titled “Parameters”publicKey
Section titled “publicKey”CryptoKey
Returns
Section titled “Returns”Promise<PreparedACLChange<Uint8Array<ArrayBufferLike>>>
Implementation of
Section titled “Implementation of”ACL.prepareAdd
prepareRemove()
Section titled “prepareRemove()”prepareRemove(
publicKey):Promise<PreparedACLChange<Uint8Array<ArrayBufferLike>>>
Defined in: yjs/src/peerborne-yjs.ts:926
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.
Parameters
Section titled “Parameters”publicKey
Section titled “publicKey”CryptoKey
Returns
Section titled “Returns”Promise<PreparedACLChange<Uint8Array<ArrayBufferLike>>>
Implementation of
Section titled “Implementation of”ACL.prepareRemove
remove()
Section titled “remove()”remove(
publicKey):Promise<Uint8Array<ArrayBufferLike>>
Defined in: yjs/src/peerborne-yjs.ts:919
Remove a user from the ACL.
Parameters
Section titled “Parameters”publicKey
Section titled “publicKey”CryptoKey
User’s public key.
Returns
Section titled “Returns”Promise<Uint8Array<ArrayBufferLike>>
A block of change(s) for the removal from the ACL.
Implementation of
Section titled “Implementation of”ACL.remove
users()
Section titled “users()”users():
Promise<CryptoKey[]>
Defined in: yjs/src/peerborne-yjs.ts:1053
Returns the list of users with a specific capability. If capability is undefined, returns all users.
Returns
Section titled “Returns”Promise<CryptoKey[]>
Implementation of
Section titled “Implementation of”ACL.users