Skip to content

js-bao-wss-client


js-bao-wss-client / DocumentAccessResult

Interface: DocumentAccessResult ​

Result of documents.validateAccess(), describing whether a user can access the document and at what permission level — the current user by default, or the user named by { userId }.

Properties ​

accessSource? ​

optional accessSource?: "owner" | "link" | "grant" | "group"

How the access was obtained, present whenever hasAccess is true. The same vocabulary documents.get() reports.


appRole? ​

optional appRole?: "owner" | "admin" | "member"

The SUBJECT's role in the app, present only when a userId was named.

Reported beside permission, never folded into it: the tag routes admit an admin or owner without a document grant, and content writes (documents.update(), block and blob writes) admit nobody without one. A caller gating a content write must decide on permission alone.


error? ​

optional error?: string


hasAccess ​

hasAccess: boolean


permission? ​

optional permission?: "owner" | "read-write" | "reader" | "admin"


success ​

success: boolean

Documentation validated against js-bao-wss-client 3.4.0 · js-bao 0.11.0 · primitive-admin 1.0.62 · primitive-app 3.1.0 — 2026-09-30