pub trait Authorizer {
    // Required methods
    fn can_read(&self, ctx: &AuthzContext<'_>) -> Result<()>;
    fn can_write(&self, ctx: &AuthzContext<'_>) -> Result<()>;
    fn can_exec(&self, ctx: &AuthzContext<'_>) -> Result<()>;
}
Expand description

A trait for types which can render authorization decisions.

Required Methods§

source

fn can_read(&self, ctx: &AuthzContext<'_>) -> Result<()>

Returns Ok if read authorization is granted, and Err otherwise.

source

fn can_write(&self, ctx: &AuthzContext<'_>) -> Result<()>

Returns Ok if write authorization is granted, and Err otherwise.

source

fn can_exec(&self, ctx: &AuthzContext<'_>) -> Result<()>

Returns Ok if execute authorization is granted, and Err otherwise.

Implementors§