@klorad/access
The Access layer. Worlds, the Entitlement the World layer asks, projections per World and the audit log.
import { createAccessPolicy, createMemoryAuditLog, auditActions } from "@klorad/access";| Export | Kind | Description |
|---|---|---|
createAccessPolicy(options) | function | Returns an AccessPolicy: the Entitlement for createInteraction, plus Worlds and views. |
AccessPolicy | type | check, world(id), worldsFor(actor), setWorld(world, by), removeWorld(id, by), view(worldId, actor). |
RolePolicy | type | Organisation roles to the Action ids they allow, or "*". |
allowEveryone | value | An Entitlement that allows everything. For demos and single user tools; the name says so. |
World, Scope, Capabilities, Principal, Presentation | type | An entitled view: see Worlds. |
assertWorld(world) | function | Validates a World and returns it; throws with the reason. |
inScope(cs, object, scope) | function | Whether an object is inside a scope. |
canEnter(world, actor) | function | Whether an actor is one of a World's principals. |
createMemoryAuditLog() | function | An in memory, append only AuditSink with entries(). |
auditActions(scene, sink) | function | Writes every Action outcome to the sink. Returns a stop function. |
AuditSink, AuditEntry, MemoryAuditLog | type | The audit port and its entries. |
Prop
Type
Scope
| Form | Contains |
|---|---|
{ all: true } | Every object. |
{ objects: [...] } | The listed ids, whatever else is given. |
{ correspondence, properties, within } | Objects matching every criterion given: kinds, property values, and within: { center, radiusMeters }. |
Something wrong or unclear? Tell your contact at Prieston Technologies.