Mnemosyne.AccessControl.View (mnemosyne v0.4.0)

Copy Markdown View Source

Builds an isolated, read-only graph snapshot before retrieval or merging.

Unauthorized nodes and their link references are removed before candidate scoring. The snapshot never carries persistence handles or ingestion receipts. This deliberately scans the repo for each view; large backends can eventually implement equivalent authorization-aware queries without changing the policy.

Summary

Functions

Builds a snapshot using a decision function; evaluation errors abort the view.

Loads all supported node types and their metadata from a backend.

Builds a view containing only nodes with the exact audience.

Functions

build(backend, decision)

@spec build({module(), term()}, (struct(), struct() | nil ->
                             {:ok, boolean()} | {:error, term()})) ::
  {:ok, {module(), term()}} | {:error, term()}

Builds a snapshot using a decision function; evaluation errors abort the view.

load(arg)

@spec load({module(), term()}) :: {:ok, [struct()], map()} | {:error, term()}

Loads all supported node types and their metadata from a backend.

scope(backend, audience)

@spec scope({module(), term()}, term()) ::
  {:ok, {module(), term()}} | {:error, term()}

Builds a view containing only nodes with the exact audience.