pub struct Scope {
pub column: String,
pub value: Option<SqlValue>,
pub session: Option<SqlValue>,
pub mode: ScopeMode,
pub keys: TableKeys,
}Expand description
A host-resolved in-site row-tenancy scope — the applied side of the resolved principal. value
is the resolved own-tenant fact (None ⇒ the actor has no tenant, e.g. a purely anonymous
Session-only request); session is the resolved anonymous-session fact (R3); mode
decides how the tenant axis restricts the operation; keys resolves the tenant column(s) per
table (the project schema — R2/R3/D2). Injected by the host on every query node (top-level,
UNION branch, INSERT … SELECT source), never guest-set. The fail-closed “no fact for a scope
that needs one” decision is made per table in the injector (a Column table with no tenant
value denies; a TenantOrSession table falls back to whichever axis fact is present).
Fields§
§column: String§value: Option<SqlValue>The resolved own-tenant value, or None for an anonymous (Session-only) actor.
session: Option<SqlValue>The resolved anonymous-session value (R3), or None when the request carries no session
fact. Only consulted for a TableScope::TenantOrSession table.
mode: ScopeMode§keys: TableKeysPer-table key resolution; TableKeys::Uniform (the default) preserves the pre-schema
single-column behavior (every table scopes on column).