Skip to main content

Policy

Trait Policy 

Source
pub trait Policy<U, S> {
    // Required method
    fn check(user: &U, ability: &str, subject: &S) -> bool;
}
Expand description

Policy trait: implementations decide whether user can perform ability on subject.

Required Methods§

Source

fn check(user: &U, ability: &str, subject: &S) -> bool

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§