Skip to main content

PolicyFilter

Trait PolicyFilter 

Source
pub trait PolicyFilter: Policy {
    // Provided method
    fn filter<'a>(
        &self,
        policies: &'a [PolicyView],
        organizations: &[ProfileOrganization],
    ) -> Vec<&'a PolicyView> { ... }
}
Expand description

Extension trait that adds a filter method to every Policy.

Implemented automatically for all T: Policy.

Provided Methods§

Source

fn filter<'a>( &self, policies: &'a [PolicyView], organizations: &[ProfileOrganization], ) -> Vec<&'a PolicyView>

Filters policies to those that should be enforced against the user. This evaluates common business rules (e.g. the policy is enabled), as well as policy-specific rules according to its Policy.

If a policy’s organization is not present in organizations, the policy is enforced by default.

Implementors§