#[non_exhaustive]pub struct Delegate<'a> {
pub session: &'a Arc<dyn Session>,
pub mode: PermissionMode,
pub rules: &'a [PermissionRule],
pub tightens_only: bool,
}Expand description
A delegate’s call as the session that relays it hands it on: judged
against the delegate’s state, in mode, and held to rules on top of the
policy’s own.
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.session: &'a Arc<dyn Session>The session the call runs in.
mode: PermissionModeThe delegate’s mode as every session between it and the policy holds
it (PermissionMode::for_delegate, once per relaying session). The
policy holds it to its own session’s mode in turn.
rules: &'a [PermissionRule]What the delegation itself adds: its deny rules refuse the call in
any mode; its allow rules are the delegate’s own grants, which answer
only the question the mode would put — never a deny, an ask rule, or
a question only a person may answer.
tightens_only: boolThe delegate may only be stricter than each session relaying it: an
agent type that may not loosen (AgentTypeSource::may_loosen) named
its mode. A session that bypasses does not take it along.
Implementations§
Source§impl<'a> Delegate<'a>
impl<'a> Delegate<'a>
Sourcepub fn of(session: &'a Arc<dyn Session>) -> Self
pub fn of(session: &'a Arc<dyn Session>) -> Self
session’s call in its own live mode, with nothing added.
pub fn new( session: &'a Arc<dyn Session>, mode: PermissionMode, rules: &'a [PermissionRule], ) -> Self
Sourcepub fn mode_under(&self, parent: PermissionMode) -> PermissionMode
pub fn mode_under(&self, parent: PermissionMode) -> PermissionMode
The mode its call is judged in, relayed through a session in parent.