Skip to main content

Authorizer

Trait Authorizer 

Source
pub trait Authorizer: Send + Sync {
    // Required method
    fn can(
        &self,
        user: &User,
        action: &str,
        resource: &str,
    ) -> Result<bool, AuthError>;
}

Required Methods§

Source

fn can( &self, user: &User, action: &str, resource: &str, ) -> Result<bool, AuthError>

Returns Ok(true) if user is allowed to perform action on resource.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§