pub struct Reach { /* private fields */ }Expand description
Where a call may act: the scopes the caller holds the method’s grant on
(within its ceiling), handed to the method beside auth. A read without a
target (list, watch) answers only from these.
A reach is live when it came from a gate: Reach::allows and
Reach::current ask the gate again, as memberships, roles and the
ceiling stand now — so a stream checks each event (IDENTITY-37: a role
revoked reaches an open stream at its next event). A hub without a gate
hands every method Reach::everywhere, which allows everything.
Implementations§
Source§impl Reach
impl Reach
Sourcepub fn everywhere() -> Reach
pub fn everywhere() -> Reach
Everything — what a method receives on a hub without a gate (login off), as today.
Sourcepub fn is_everywhere(&self) -> bool
pub fn is_everywhere(&self) -> bool
Whether the grant is held on *.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Whether the grant is held nowhere (a public method called by a
caller who holds no role listing it).
Sourcepub fn grant(&self) -> Option<&Grant>
pub fn grant(&self) -> Option<&Grant>
The grant this reach is for; None on a hub without a gate.
Sourcepub fn allows(&self, target: &str) -> bool
pub fn allows(&self, target: &str) -> bool
Whether the call may act on target — asked of the gate as it
stands now. Without a gate: always.
Sourcepub fn current(&self) -> Option<Reach>
pub fn current(&self) -> Option<Reach>
The reach as it stands now: None once the grant is held nowhere (a
stream should end). Without a gate: unchanged.
Sourcepub fn covers(&self, chain: &[ScopeRef]) -> bool
pub fn covers(&self, chain: &[ScopeRef]) -> bool
Whether the reach covers a target whose chain is chain (as
Resolve::chain gives it), by this snapshot — no new question to
the gate. Prefer Reach::allows where the answer must be current.