Skip to main content

PermissionMap

Trait PermissionMap 

Source
pub trait PermissionMap {
    // Required methods
    fn permissions_for(&self, cap: &Capability) -> BTreeSet<TeRule>;
    fn granted_access(&self, rule: &TeRule) -> Option<AccessRequest>;
}
Expand description

Maps a UCAN capability to the TE rules it grants. The injection point for the concrete action vocabulary — the production impl is crate::mac::permission_map::ScopePermissionMap (#676).

Required Methods§

Source

fn permissions_for(&self, cap: &Capability) -> BTreeSet<TeRule>

The TE rules a single capability grants. Empty for an unrecognized capability — it grants nothing (fail-closed; never a wildcard rule).

Source

fn granted_access(&self, rule: &TeRule) -> Option<AccessRequest>

The most-permissive concrete access a rule grants at runtime, used to check the rule against the grant. None for an unrecognized rule (treated as an escalation). Must be deterministic and independent of permissions_for.

Implementors§