KloradDocs

@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";
ExportKindDescription
createAccessPolicy(options)functionReturns an AccessPolicy: the Entitlement for createInteraction, plus Worlds and views.
AccessPolicytypecheck, world(id), worldsFor(actor), setWorld(world, by), removeWorld(id, by), view(worldId, actor).
RolePolicytypeOrganisation roles to the Action ids they allow, or "*".
allowEveryonevalueAn Entitlement that allows everything. For demos and single user tools; the name says so.
World, Scope, Capabilities, Principal, PresentationtypeAn entitled view: see Worlds.
assertWorld(world)functionValidates a World and returns it; throws with the reason.
inScope(cs, object, scope)functionWhether an object is inside a scope.
canEnter(world, actor)functionWhether an actor is one of a World's principals.
createMemoryAuditLog()functionAn in memory, append only AuditSink with entries().
auditActions(scene, sink)functionWrites every Action outcome to the sink. Returns a stop function.
AuditSink, AuditEntry, MemoryAuditLogtypeThe audit port and its entries.

Prop

Type

Scope

FormContains
{ 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.

On this page