Skip to main content

Authorizer

Trait Authorizer 

Source
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§

Source

fn can(&self, roles: &[String], resource: &str, action: &Action<'_>) -> bool

Whether a principal holding roles may perform action on resource (the resource’s base_path()).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§