Test for user system and comments
This commit is contained in:
@@ -42,6 +42,15 @@ impl TypedSession {
|
||||
self.0.get(Self::ROLE_KEY).await
|
||||
}
|
||||
|
||||
pub async fn has_admin_permissions(&self) -> Result<bool> {
|
||||
let role = self.0.get(Self::ROLE_KEY).await?;
|
||||
if let Some(Role::Admin) = role {
|
||||
Ok(true)
|
||||
} else {
|
||||
Ok(false)
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn clear(&self) {
|
||||
self.0.clear().await;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user