pub trait AuthorizationStorage: Send + Sync {
// Required methods
fn store_role<'life0, 'life1, 'async_trait>(
&'life0 self,
role: &'life1 Role,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_role<'life0, 'life1, 'async_trait>(
&'life0 self,
role_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Role>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn update_role<'life0, 'life1, 'async_trait>(
&'life0 self,
role: &'life1 Role,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn delete_role<'life0, 'life1, 'async_trait>(
&'life0 self,
role_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn list_roles<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Role>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn assign_role<'life0, 'life1, 'async_trait>(
&'life0 self,
user_role: &'life1 UserRole,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn remove_role<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
user_id: &'life1 str,
role_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn get_user_roles<'life0, 'life1, 'async_trait>(
&'life0 self,
user_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<UserRole>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_role_users<'life0, 'life1, 'async_trait>(
&'life0 self,
role_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<UserRole>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}
Expand description
Authorization storage trait
Required Methods§
Sourcefn store_role<'life0, 'life1, 'async_trait>(
&'life0 self,
role: &'life1 Role,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn store_role<'life0, 'life1, 'async_trait>(
&'life0 self,
role: &'life1 Role,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Store a role
Sourcefn get_role<'life0, 'life1, 'async_trait>(
&'life0 self,
role_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Role>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_role<'life0, 'life1, 'async_trait>(
&'life0 self,
role_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Role>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get a role by ID
Sourcefn update_role<'life0, 'life1, 'async_trait>(
&'life0 self,
role: &'life1 Role,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update_role<'life0, 'life1, 'async_trait>(
&'life0 self,
role: &'life1 Role,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Update a role
Sourcefn delete_role<'life0, 'life1, 'async_trait>(
&'life0 self,
role_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_role<'life0, 'life1, 'async_trait>(
&'life0 self,
role_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete a role
Sourcefn list_roles<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Role>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_roles<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Role>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List all roles
Sourcefn assign_role<'life0, 'life1, 'async_trait>(
&'life0 self,
user_role: &'life1 UserRole,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn assign_role<'life0, 'life1, 'async_trait>(
&'life0 self,
user_role: &'life1 UserRole,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Assign a role to a user
Sourcefn remove_role<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
user_id: &'life1 str,
role_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn remove_role<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
user_id: &'life1 str,
role_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Remove a role from a user