Skip to main content

ApprovalIdentityResolver

Trait ApprovalIdentityResolver 

pub trait ApprovalIdentityResolver: Send + Sync {
    // Required method
    fn groups_for(
        &self,
        cfg: &SopApprovalConfig,
        principal: &ApprovalPrincipal,
    ) -> Vec<String>;

    // Provided method
    fn is_member(
        &self,
        cfg: &SopApprovalConfig,
        principal: &ApprovalPrincipal,
        group: &str,
    ) -> bool { ... }
}
Expand description

Resolve an approval principal to the approver groups it is a member of, against the live [sop.approval] config passed in at use-time (the single source of truth - never a cloned copy that could drift on reload).

Required Methods§

Source

fn groups_for( &self, cfg: &SopApprovalConfig, principal: &ApprovalPrincipal, ) -> Vec<String>

The groups this principal belongs to under cfg (may be empty).

Provided Methods§

Source

fn is_member( &self, cfg: &SopApprovalConfig, principal: &ApprovalPrincipal, group: &str, ) -> bool

Whether the principal is a member of group under cfg.

Implementors§