From afecf1b60760ca9802e061203e19e5c33a9ef36b Mon Sep 17 00:00:00 2001
From: Alexandru Munteanu <alexandru.munt@gmail.com>
Date: Thu, 31 May 2018 15:27:35 +0300
Subject: [PATCH] fix(manuscript-manager): fix eic check on recommendation

---
 .../src/routes/fragmentsRecommendations/post.js              | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/packages/component-manuscript-manager/src/routes/fragmentsRecommendations/post.js b/packages/component-manuscript-manager/src/routes/fragmentsRecommendations/post.js
index 7ce8aeb80..35e052350 100644
--- a/packages/component-manuscript-manager/src/routes/fragmentsRecommendations/post.js
+++ b/packages/component-manuscript-manager/src/routes/fragmentsRecommendations/post.js
@@ -7,7 +7,6 @@ const mailService = require('pubsweet-component-mail-service')
 
 module.exports = models => async (req, res) => {
   const { recommendation, comments, recommendationType } = req.body
-
   if (!helpers.checkForUndefinedParams(recommendationType))
     return res.status(400).json({ error: 'Recommendation type is required.' })
 
@@ -35,7 +34,6 @@ module.exports = models => async (req, res) => {
     collection,
     path: req.route.path,
   }
-
   const canPost = await authsome.can(req.user, 'POST', target)
   if (!canPost)
     return res.status(403).json({
@@ -52,7 +50,7 @@ module.exports = models => async (req, res) => {
 
   newRecommendation.recommendation = recommendation || undefined
   newRecommendation.comments = comments || undefined
-  if (reqUser.editorInChief === true) {
+  if (reqUser.editorInChief || reqUser.admin) {
     await collectionHelper.updateFinalStatusByRecommendation(
       collection,
       recommendation,
@@ -62,7 +60,6 @@ module.exports = models => async (req, res) => {
       collection,
       recommendation,
     )
-
     const {
       title,
       submittingAuthor,
-- 
GitLab