From a3c5e5a46661f10a04e0f79c5719cc572a5d0587 Mon Sep 17 00:00:00 2001 From: fpellet Date: Fri, 15 Apr 2022 16:29:51 +0200 Subject: [PATCH] Allow moderator to approve anwser --- .../java/com/erudika/scoold/controllers/QuestionController.java | 2 +- src/main/resources/templates/macro.vm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/erudika/scoold/controllers/QuestionController.java b/src/main/java/com/erudika/scoold/controllers/QuestionController.java index fb49b769..da6cd988 100755 --- a/src/main/java/com/erudika/scoold/controllers/QuestionController.java +++ b/src/main/java/com/erudika/scoold/controllers/QuestionController.java @@ -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()) { diff --git a/src/main/resources/templates/macro.vm b/src/main/resources/templates/macro.vm index 4a7e31c8..43d8dcec 100755 --- a/src/main/resources/templates/macro.vm +++ b/src/main/resources/templates/macro.vm @@ -703,7 +703,7 @@
#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)) #elseif ($approvedAnswer)