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:
Geometrically authored and GitHub committed 2020-11-15 19:58:11 -07:00
1 parent da911bfeb8
commit 0500994def
14 files changed
+1830 -332

No files matched your search

+4 -3
View File
@@ -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)
}
}