Trait axum_login::AuthzBackend

source ·
pub trait AuthzBackend
where Self: AuthnBackend,
{ type Permission: Hash + Eq + Send + Sync; // Provided methods fn get_user_permissions<'life0, 'life1, 'async_trait>( &'life0 self, _user: &'life1 Self::User ) -> Pin<Box<dyn Future<Output = Result<HashSet<Self::Permission>, Self::Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn get_group_permissions<'life0, 'life1, 'async_trait>( &'life0 self, _user: &'life1 Self::User ) -> Pin<Box<dyn Future<Output = Result<HashSet<Self::Permission>, Self::Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn get_all_permissions<'life0, 'life1, 'async_trait>( &'life0 self, user: &'life1 Self::User ) -> Pin<Box<dyn Future<Output = Result<HashSet<Self::Permission>, Self::Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn has_perm<'life0, 'life1, 'async_trait>( &'life0 self, user: &'life1 Self::User, perm: Self::Permission ) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } }
Expand description

A backend which can authorize users.

Backends must implement AuthnBackend.

Required Associated Types§

source

type Permission: Hash + Eq + Send + Sync

Permission type.

Provided Methods§

source

fn get_user_permissions<'life0, 'life1, 'async_trait>( &'life0 self, _user: &'life1 Self::User ) -> Pin<Box<dyn Future<Output = Result<HashSet<Self::Permission>, Self::Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Gets the permissions for the provided user.

source

fn get_group_permissions<'life0, 'life1, 'async_trait>( &'life0 self, _user: &'life1 Self::User ) -> Pin<Box<dyn Future<Output = Result<HashSet<Self::Permission>, Self::Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Gets the group permissions for the provided user.

source

fn get_all_permissions<'life0, 'life1, 'async_trait>( &'life0 self, user: &'life1 Self::User ) -> Pin<Box<dyn Future<Output = Result<HashSet<Self::Permission>, Self::Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Gets all permissions for the provided user.

source

fn has_perm<'life0, 'life1, 'async_trait>( &'life0 self, user: &'life1 Self::User, perm: Self::Permission ) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Returns a result which is true when the provided user has the provided permission and otherwise is false.

Object Safety§

This trait is not object safe.

Implementors§