pub enum PolicyEnforcementMode {
LegacyRbac,
PolicyOnly,
}Expand description
Selects the behaviour of the policy evaluator when no statement
matches the requested (action, resource) pair. See the module
docs for the semantics of each variant.
Variants§
LegacyRbac
Fall back to the role-based decision when no policy matches.
PolicyOnly
Treat “no matching policy” as DefaultDeny.
Implementations§
Source§impl PolicyEnforcementMode
impl PolicyEnforcementMode
pub fn as_str(self) -> &'static str
Sourcepub fn parse(value: &str) -> Option<Self>
pub fn parse(value: &str) -> Option<Self>
Parse a configuration value. Returns None for any string that
is not exactly one of the two accepted modes — callers turn that
None into the “invalid value” rejection at config-write time.
Sourcepub const fn default_fresh_bootstrap() -> Self
pub const fn default_fresh_bootstrap() -> Self
Default for a fresh bootstrap (no prior config, no prior users). Fresh installs start in the strict posture so they never carry the legacy RBAC fallback as accumulated technical debt.
Sourcepub const fn default_existing_install() -> Self
pub const fn default_existing_install() -> Self
Default for an existing install that has no
enforcement_mode key set. Preserves pre-#712 behaviour so the
upgrade is non-disruptive; operators move to policy_only
explicitly via the migration command (S5B).
Trait Implementations§
Source§impl Clone for PolicyEnforcementMode
impl Clone for PolicyEnforcementMode
Source§fn clone(&self) -> PolicyEnforcementMode
fn clone(&self) -> PolicyEnforcementMode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PolicyEnforcementMode
impl Debug for PolicyEnforcementMode
Source§impl Display for PolicyEnforcementMode
impl Display for PolicyEnforcementMode
Source§impl PartialEq for PolicyEnforcementMode
impl PartialEq for PolicyEnforcementMode
Source§fn eq(&self, other: &PolicyEnforcementMode) -> bool
fn eq(&self, other: &PolicyEnforcementMode) -> bool
self and other values to be equal, and is used by ==.impl Copy for PolicyEnforcementMode
impl Eq for PolicyEnforcementMode
impl StructuralPartialEq for PolicyEnforcementMode
Auto Trait Implementations§
impl Freeze for PolicyEnforcementMode
impl RefUnwindSafe for PolicyEnforcementMode
impl Send for PolicyEnforcementMode
impl Sync for PolicyEnforcementMode
impl Unpin for PolicyEnforcementMode
impl UnsafeUnpin for PolicyEnforcementMode
impl UnwindSafe for PolicyEnforcementMode
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request