Trait AuthorizationService

Source
pub trait AuthorizationService<V: IntoIterator<Item = String>>:
    Send
    + Sync
    + 'static {
    // Required methods
    fn user_role<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        user_id: &'life1 String,
        login_type: &'life2 LoginType,
    ) -> Pin<Box<dyn Future<Output = V> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn user_permission<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        user_id: &'life1 String,
        login_type: &'life2 LoginType,
    ) -> Pin<Box<dyn Future<Output = V> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn verify_token<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        user_id: &'life1 String,
        login_type: &'life2 LoginType,
    ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}

Required Methods§

Source

fn user_role<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, user_id: &'life1 String, login_type: &'life2 LoginType, ) -> Pin<Box<dyn Future<Output = V> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Returns the roles of the user with the given user_id and login_type.

Source

fn user_permission<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, user_id: &'life1 String, login_type: &'life2 LoginType, ) -> Pin<Box<dyn Future<Output = V> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Returns the permission of the user with the given user_id and login_type.

Source

fn verify_token<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, user_id: &'life1 String, login_type: &'life2 LoginType, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Verifies the token of the user with the given user_id and login_type.

Implementors§