pub trait Authorizer: Send + Sync {
// Required method
fn can(&self, roles: &[String], resource: &str, action: &Action<'_>) -> bool;
}Expand description
A pluggable authorization policy. can is synchronous and called several
times per request, so an implementation must not perform I/O here — a
DB-backed one reads a pre-loaded in-memory cache.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".