pub enum Level {
Read,
Propose,
Write,
Own,
}Expand description
Grant strength. Level::Read is implied by Level::Write, which
is implied by Level::Own.
The implication is the derived Ord, which follows declaration
order, and Effective::allows compares with >=. A new level must
therefore be declared in strength order or every existing check
silently changes meaning.
Variants§
Read
Clone and fetch a repository; read the node-scoped endpoints.
Spelled read on a repository and auditor on @node.
Propose
Everything Level::Read allows, plus opening a proposal: a
push to refs/for/<branch>/<user>/<topic> (D53) and no other
ref. Spelled propose (D60).
The pusher’s own name is a required segment, and that is what
keeps two holders of this level apart. Several people hold
propose at once, by construction – it is the grant given to
contributors a repository does not trust – so without it whoever
pushed second would take over or delete the first one’s proposal,
and the log would record the takeover as an ordinary update by an
authorized pusher. A write holder is not held to the rule,
because a write holder can already reach every ref anyway.
This is the grant for a contributor the operator does not trust
with the repository’s branches, which until it existed was not
expressible: opening a review needed write, and write also
reaches every unprotected ref. Taking a contribution from a
stranger meant handing them the repository.
It is enforced in two places because it has to be. The
smart-HTTP boundary admits the push at this level, and cannot do
better: git sends the ref list only after the server agrees to
receive the pack, so no refname exists when git_requirement
runs. The refname first exists when the pre-receive hook
reports it, and that is where a proposal-only grant is held to
proposals. Nothing is applied in between – git applies no ref
until the hook exits zero.
Write
Everything Level::Propose allows, plus pushing any other ref,
provisioning a workspace, and submitting ops.
Own
Everything Level::Write allows, plus authorizing a landing on
a protected ref of this repository (D42). Spelled own.
This is the repository-scoped administrative action the module
documentation used to say did not exist. It is not a stronger
push: on a protected ref an owner’s assent is what the gate asks
for, and write alone no longer answers it.