Skip to main content

Policy

Trait Policy 

Source
pub trait Policy:
    Send
    + Sync
    + 'static {
    // Required method
    fn policy_type(&self) -> PolicyType;

    // Provided methods
    fn exempt_roles(&self) -> &[OrganizationUserType] { ... }
    fn exempt_providers(&self) -> bool { ... }
    fn applicable_statuses(&self) -> &[OrganizationUserStatusType] { ... }
}
Expand description

Defines the filtering behavior for a specific policy type.

Implement this trait to control how a policy is enforced.

Required Methods§

Source

fn policy_type(&self) -> PolicyType

Returns the policy type this definition handles.

Provided Methods§

Source

fn exempt_roles(&self) -> &[OrganizationUserType]

Returns the organization roles that are exempt from this policy.

Defaults to Owner and Admin.

Source

fn exempt_providers(&self) -> bool

Returns whether provider users are exempt from this policy.

Defaults to true.

Source

fn applicable_statuses(&self) -> &[OrganizationUserStatusType]

Returns the organization membership statuses for which this policy applies.

Defaults to Accepted and Confirmed.

Implementors§