Allow admin to perform same action as moderators
parent
ba90ca471b
commit
b099448006
|
@ -420,7 +420,7 @@ pub fn moderation_actions(data: Json<ModerationAction>, mut cookies: Cookies) ->
|
||||||
"reason": "NULL token",
|
"reason": "NULL token",
|
||||||
});
|
});
|
||||||
} else if user.session_token == token.value() { // if token matches
|
} else if user.session_token == token.value() { // if token matches
|
||||||
if user.role == UserType::Moderator {
|
if user.role == UserType::Moderator || user.role == UserType::Admin {
|
||||||
match data.action {
|
match data.action {
|
||||||
ModActions::Kick => kick(&data.target),
|
ModActions::Kick => kick(&data.target),
|
||||||
ModActions::Ban => ban(&data.target),
|
ModActions::Ban => ban(&data.target),
|
||||||
|
|
Loading…
Reference in New Issue