pub struct EffectiveRights { /* private fields */ }Expand description
The rights one subject holds on one resource, closed under implication.
Implication (§4.2): own ⇒ maintain ⇒ commit on the same resource, and
ns.admin ⇒ create plus own on every repository in the namespace. The
VTC evaluates this before projecting; it is repeated here so an adapter
handed a partial set (say, own alone) still maps it correctly.
Implication decides what a person may do, not which forge role they
get. A namespace admin gets no role on the forge (decided 2026-09-25):
git.ns.admin is exercised through the VTC and the bridge, never as an
organisation owner or a repository role. So the rights ns.admin implies
are held but never
projected; only a repository right granted
in its own name (own, maintain, commit.sign) reaches a forge role.
Two values are equal when they hold the same rights and project the
same ones — i.e. when their canonical grants
are equal. [ns.admin] and [ns.admin, own] hold the same rights but
are different values: only the second projects own. Serialised as the
canonical grants, so a round trip is the identity.
Implementations§
Source§impl EffectiveRights
impl EffectiveRights
Sourcepub const NONE: EffectiveRights
pub const NONE: EffectiveRights
No rights at all.
Sourcepub fn from_granted(granted: impl IntoIterator<Item = Right>) -> Self
pub fn from_granted(granted: impl IntoIterator<Item = Right>) -> Self
The closure of granted under implication.
Sourcepub fn repo_tier(self) -> Option<Right>
pub fn repo_tier(self) -> Option<Right>
The repository-level tier held, by any route (including ns.admin’s
implied own): own, then maintain, then commit. None when none of
those is held. For authorisation; the forge role comes from
EffectiveRights::forge_tier.
Sourcepub fn forge_tier(self) -> Option<Right>
pub fn forge_tier(self) -> Option<Right>
The repository-level tier that decides the forge role: own, then
maintain, then commit, from repository rights granted in their own
name. ns.admin alone gives None — a namespace admin gets no forge
role.
Trait Implementations§
Source§impl Clone for EffectiveRights
impl Clone for EffectiveRights
impl Copy for EffectiveRights
Source§impl Debug for EffectiveRights
impl Debug for EffectiveRights
Source§impl Default for EffectiveRights
impl Default for EffectiveRights
Source§impl<'de> Deserialize<'de> for EffectiveRights
impl<'de> Deserialize<'de> for EffectiveRights
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
impl Eq for EffectiveRights
Source§impl Hash for EffectiveRights
impl Hash for EffectiveRights
Source§impl PartialEq for EffectiveRights
impl PartialEq for EffectiveRights
Source§impl Serialize for EffectiveRights
As the canonical grants, not every held
right: writing the rights ns.admin implies would read back as
repository rights granted in their own name, and project.
impl Serialize for EffectiveRights
As the canonical grants, not every held
right: writing the rights ns.admin implies would read back as
repository rights granted in their own name, and project.