pub struct GovernancePolicy {
pub write: GovernanceLevel,
pub promote: GovernanceLevel,
pub delete: GovernanceLevel,
pub approver: ApproverType,
pub inherit: bool,
}Expand description
Governance policy attached to a namespace’s standard memory
(stored in metadata.governance).
Default policy when a standard has no metadata.governance:
{ write: Any, promote: Any, delete: Owner, approver: Human, inherit: true }.
v0.6.2 (S34 defensive): promote, delete, and approver carry
#[serde(default)] so partial-policy payloads (a common shape for
operator CLIs / test harnesses that only care about write) round-trip
instead of 400-ing out on missing fields. write remains required —
it’s the core knob a policy is attempting to set.
v0.6.3.1 (P4, audit G1): inherit controls whether parent-namespace
policies bubble up. Default true matches the architecture page T2
promise of “Hierarchical policy inheritance (default at org/,
overridable at org/team/)”. Setting inherit: false on a child
stops the leaf-first walk in resolve_governance_policy, providing
an explicit opt-out path for scoped overrides (e.g. an audit
sandbox under a fully-governed parent).
Fields§
§write: GovernanceLevel§promote: GovernanceLevel§delete: GovernanceLevel§approver: ApproverType§inherit: boolv0.6.3.1 (P4, G1): when true (default), missing policy at a
child namespace falls through to the parent in the chain. When
false, the walk stops at this level — child operations are
gated by THIS policy and parents are not consulted. Backfilled
to true on existing rows by migration 0012_governance_inherit
to preserve the architecturally-promised semantics.
Implementations§
Trait Implementations§
Source§impl Clone for GovernancePolicy
impl Clone for GovernancePolicy
Source§fn clone(&self) -> GovernancePolicy
fn clone(&self) -> GovernancePolicy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GovernancePolicy
impl Debug for GovernancePolicy
Source§impl Default for GovernancePolicy
impl Default for GovernancePolicy
Source§impl<'de> Deserialize<'de> for GovernancePolicy
impl<'de> Deserialize<'de> for GovernancePolicy
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for GovernancePolicy
impl PartialEq for GovernancePolicy
Source§impl Serialize for GovernancePolicy
impl Serialize for GovernancePolicy
impl Eq for GovernancePolicy
impl StructuralPartialEq for GovernancePolicy
Auto Trait Implementations§
impl Freeze for GovernancePolicy
impl RefUnwindSafe for GovernancePolicy
impl Send for GovernancePolicy
impl Sync for GovernancePolicy
impl Unpin for GovernancePolicy
impl UnsafeUnpin for GovernancePolicy
impl UnwindSafe for GovernancePolicy
Blanket Implementations§
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§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.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