Struct ResolvedGrants
#[non_exhaustive]pub struct ResolvedGrants {
pub admin: bool,
pub allowed_agents: Vec<AgentAlias>,
pub config_write_paths: Vec<String>,
pub allowed_tools: Vec<String>,
pub resources: BTreeMap<Resource, BTreeSet<Verb>>,
}Expand description
The merged authorization result for one principal: what it may touch and
how. Produced by the shared grant resolver from permission profiles at a
specific authorization-policy generation; consumed by dispatch
classification, the gateway router, and deep resource checks. Never
stored on a Principal — consumers re-resolve when the generation
changes.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.admin: boolFull access to everything. Short-circuits all other checks. An explicit administrator grant dominates the ordinary grant set.
allowed_agents: Vec<AgentAlias>Agent aliases this principal may bind or address. Empty = none;
broad access requires the explicit WILDCARD entry.
config_write_paths: Vec<String>Dotted config path prefixes this principal may write. A trailing
.* grants the subtree; a bare path grants that exact prop; the
WILDCARD entry grants every path. Empty = none.
allowed_tools: Vec<String>Tool names this principal may cause an agent to run. Empty = none;
broad access requires the explicit WILDCARD entry. (The agent’s
own tool policy still applies on top.)
resources: BTreeMap<Resource, BTreeSet<Verb>>Resource-class grants: which verbs are permitted per resource. Missing resource = deny.
Implementations§
Source§impl ResolvedGrants
impl ResolvedGrants
Sourcepub fn all() -> Self
pub fn all() -> Self
The allow-everything grant set (admin). Used for the shared-operator sentinel so legacy single-operator deployments keep today’s behaviour.
Sourcepub fn permits(&self, resource: Resource, verb: Verb) -> bool
pub fn permits(&self, resource: Resource, verb: Verb) -> bool
Whether this grant set permits verb on resource.
Sourcepub fn may_use_agent(&self, alias: &str) -> bool
pub fn may_use_agent(&self, alias: &str) -> bool
Whether this principal may bind or address the given agent alias.
An empty selector list grants no agents; broad access requires the
explicit WILDCARD entry or admin.
Sourcepub fn may_use_tool(&self, tool: &str) -> bool
pub fn may_use_tool(&self, tool: &str) -> bool
Whether this principal may cause the named tool to run. An empty
selector list grants no tools; broad access requires the explicit
WILDCARD entry or admin.
Sourcepub fn may_write_config(&self, path: &str) -> bool
pub fn may_write_config(&self, path: &str) -> bool
Whether this principal may write the given dotted config path.
A granted foo.* covers foo itself and every descendant; a
granted bare foo.bar covers exactly that prop; the WILDCARD
entry covers every path. Empty = none.
Trait Implementations§
Source§impl Clone for ResolvedGrants
impl Clone for ResolvedGrants
Source§fn clone(&self) -> ResolvedGrants
fn clone(&self) -> ResolvedGrants
1.0.0 (const: unstable) · §fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more