pub enum PermissionTier {
ReadOnly,
SandboxEdit,
FullAccess,
}Expand description
Permission tiers — who may authorize this action? — ordered by the
authority an action demands (survey §3.4.3). The Ord derive makes
ReadOnly < SandboxEdit < FullAccess, so “does the granted tier cover the
required tier?” is a single >=.
§This ladder does not answer “can it be undone?”
It used to read as though it did. SandboxEdit was documented as
“reversible local mutation” and FullAccess as “externally-consequential
or irreversible”, and that or quietly fused two independent
questions onto one rung: a git push, a production INSERT, and a charged
card are all FullAccess and have three different rollback contracts.
Collapsed, the runtime had two options and no third — gate every
FullAccess action identically (approval fatigue, and the predictable
response is that someone turns the gate off), or relax the tier and lose
the permanent cases along with the recoverable ones.
The rollback contract is now car_ir::Reversibility, classified by
classify_reversibility from its own keyword sets, and the two axes are
reported side by side. Nothing about this enum changed when that axis
landed — not its ordering, not its variants, not what
RiskClassifier::classify returns for any action. Only this
documentation changed, because it had been describing the other axis.
Variants§
ReadOnly
Observation only — state reads, retrieval, static inspection, log analysis. Nothing is mutated, so the only authority at stake is the authority to look.
SandboxEdit
Mutation whose blast radius stops at the session’s own workspace — state writes, local patches, sandboxed tool calls, temporary dependency installs inside an isolated workspace. Authorizable by a standing grant precisely because nothing crosses the sandbox boundary.
FullAccess
Externally consequential — effects that cross the sandbox boundary:
network egress, credentials/secrets, deployment, destructive filesystem
or VCS operations, financial/medical actions, physical control. Needs
the top standing grant and, by default (require_approval_at), a human
decision as well.
Whether such an action can afterwards be undone is a separate
question this rung does not answer: it holds read_secret (nothing to
undo), git push (force-push the prior ref), and a charged card (no
undo at all) alike. Ask classify_reversibility for that.
Implementations§
Source§impl PermissionTier
impl PermissionTier
Sourcepub fn covers(self, required: PermissionTier) -> bool
pub fn covers(self, required: PermissionTier) -> bool
Does a session granted self cover an action requiring required?
pub fn as_str(self) -> &'static str
pub fn from_str_opt(s: &str) -> Option<PermissionTier>
Trait Implementations§
Source§impl Clone for PermissionTier
impl Clone for PermissionTier
Source§fn clone(&self) -> PermissionTier
fn clone(&self) -> PermissionTier
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for PermissionTier
Source§impl Debug for PermissionTier
impl Debug for PermissionTier
Source§impl<'de> Deserialize<'de> for PermissionTier
impl<'de> Deserialize<'de> for PermissionTier
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<PermissionTier, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<PermissionTier, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for PermissionTier
Source§impl Hash for PermissionTier
impl Hash for PermissionTier
Source§impl Ord for PermissionTier
impl Ord for PermissionTier
Source§fn cmp(&self, other: &PermissionTier) -> Ordering
fn cmp(&self, other: &PermissionTier) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for PermissionTier
impl PartialEq for PermissionTier
Source§impl PartialOrd for PermissionTier
impl PartialOrd for PermissionTier
Source§impl Serialize for PermissionTier
impl Serialize for PermissionTier
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for PermissionTier
Auto Trait Implementations§
impl Freeze for PermissionTier
impl RefUnwindSafe for PermissionTier
impl Send for PermissionTier
impl Sync for PermissionTier
impl Unpin for PermissionTier
impl UnsafeUnpin for PermissionTier
impl UnwindSafe for PermissionTier
Blanket Implementations§
impl<T> Boilerplate for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more