pub trait Policy<M>:
Send
+ Sync
+ 'static {
// Required method
fn allows(&self, cx: &Cx, ability: Ability<'_, M>) -> bool;
}Expand description
Decides which Abilitys the current user has over a resource’s records.
A closure |cx: &Cx, ability: Ability<'_, M>| -> bool is a policy, and the
building blocks combine with and and or.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".