You've already forked AstralRinth
forked from didirus/AstralRinth
Moderation + Mod Editing (#101)
* Moderation + Mod Editing WIP * Run prepare, fix perms * Make it compile * Finish moderation and edit routes * More fixes * Use better queries * Final Fixes
This commit is contained in:
@@ -95,9 +95,10 @@ where
|
||||
{
|
||||
let user = get_user_from_headers(headers, executor).await?;
|
||||
|
||||
match user.role {
|
||||
Role::Moderator | Role::Admin => Ok(user),
|
||||
_ => Err(AuthenticationError::InvalidCredentialsError),
|
||||
if user.role.is_mod() {
|
||||
Ok(user)
|
||||
} else {
|
||||
Err(AuthenticationError::InvalidCredentialsError)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user