pub(crate) trait EnforceablePolicy: PolicyDefinition {
// Required methods
fn get_enforced(
&self,
organization_id: OrganizationId,
policies: &[Policy],
organization_user_policy_contexts: &[OrganizationUserPolicyContext],
) -> PolicyDecision<Self>
where Self: Sized;
fn get_all_enforced(
&self,
policies: &[Policy],
organization_user_policy_contexts: &[OrganizationUserPolicyContext],
) -> Vec<PolicyDecision<Self>>
where Self: Sized;
}Expand description
Evaluates whether a PolicyDefinition is enforced against the current user.
Required Methods§
Sourcefn get_enforced(
&self,
organization_id: OrganizationId,
policies: &[Policy],
organization_user_policy_contexts: &[OrganizationUserPolicyContext],
) -> PolicyDecision<Self>where
Self: Sized,
fn get_enforced(
&self,
organization_id: OrganizationId,
policies: &[Policy],
organization_user_policy_contexts: &[OrganizationUserPolicyContext],
) -> PolicyDecision<Self>where
Self: Sized,
Constructs a new PolicyDecision for a specific organization, evaluating
whether the policy should be enforced against the user or not.
If the organization context is missing for the corresponding organization, it will be enforced by default (err on the side of enforcement).
Sourcefn get_all_enforced(
&self,
policies: &[Policy],
organization_user_policy_contexts: &[OrganizationUserPolicyContext],
) -> Vec<PolicyDecision<Self>>where
Self: Sized,
fn get_all_enforced(
&self,
policies: &[Policy],
organization_user_policy_contexts: &[OrganizationUserPolicyContext],
) -> Vec<PolicyDecision<Self>>where
Self: Sized,
Constructs a new PolicyDecision for all the user’s organization, evaluating
whether each organization’s policy should be enforced against the user or not.
This will always return a PolicyDecision for each organization.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".