Skip to content

Commit

Permalink
Merge pull request #301 from fpellet/allow-mod-anwser
Browse files Browse the repository at this point in the history
Allow moderator to approve answer
  • Loading branch information
albogdano committed Apr 16, 2022
2 parents 55c2a86 + a3c5e5a commit 2828613
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Expand Up @@ -280,7 +280,7 @@ public String approve(@PathVariable String id, @PathVariable String answerid, Ht
return "redirect:" + req.getRequestURI();
}
if (utils.canEdit(showPost, authUser) && answerid != null &&
(utils.isMine(showPost, authUser) || utils.isAdmin(authUser))) {
(utils.isMine(showPost, authUser) || utils.isMod(authUser))) {
Reply answer = (Reply) pc.read(answerid);

if (answer != null && answer.isReply()) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/templates/macro.vm
Expand Up @@ -703,7 +703,7 @@
<div class="left mtm mrl approve-answer-btn">
#set($approvedAnswer = $showpost.id.equals($parentpost.answerid))
#if ($approvedAnswer) #set($onclass = "green-text text-lighten-1") #else #set($onclass = "") #end
#if ($authenticated && $showpost.isReply() && ($parentpost.creatorid.equals($authUser.id) || $isAdmin))
#if ($authenticated && $showpost.isReply() && ($parentpost.creatorid.equals($authUser.id) || $isMod))
<a href="$questionlink/$!parentpost.id/approve/$!showpost.id" class="approve-answer $!{onclass}"
title="Approve answer"><i class="fa fa-check-circle fa-3x"></i></a>
#elseif ($approvedAnswer)
Expand Down

0 comments on commit 2828613

Please sign in to comment.