Skip to main content

op_scopes

Function op_scopes 

Source
pub fn op_scopes(
    kind: &OpKind,
    review_repo: impl Fn(&str) -> Option<String>,
) -> Vec<Scope>
Expand description

Scopes an op must be authorized against, never empty.

review_repo resolves a review id to the repository its target ref names, so posting a verdict needs write on the repository under review rather than a node-wide grant. An op that resolves to no repository is authorized against Scope::Node: that is the fail-closed rule, and being an exhaustive match, a new OpKind variant will not compile until somebody classifies it.