zahmis 4 years ago
parent
commit
3ef3afb8a5
1 changed files with 3 additions and 3 deletions
  1. 3 3
      packages/app/src/server/routes/apiv3/slack-integration.js

+ 3 - 3
packages/app/src/server/routes/apiv3/slack-integration.js

@@ -69,12 +69,12 @@ module.exports = (crowi) => {
       commandPermission = JSON.parse(configManager.getConfig('crowi', 'slackbot:withoutProxy:commandPermission'));
       commandPermission = JSON.parse(configManager.getConfig('crowi', 'slackbot:withoutProxy:commandPermission'));
     }
     }
 
 
-    const command = parseSlashCommand(req.body).growiCommandType;
+    const growiCommand = parseSlashCommand(req.body);
     const fromChannel = req.body.channel_name;
     const fromChannel = req.body.channel_name;
-    const isPermitted = checkPermission(commandPermission, command, fromChannel);
+    const isPermitted = checkPermission(commandPermission, growiCommand.growiCommandType, fromChannel);
     if (isPermitted) return next();
     if (isPermitted) return next();
 
 
-    return res.send(`It is not allowed to run '${command}' command to this GROWI.`).status(403);
+    return res.send(`It is not allowed to run '${growiCommand.growiCommandType}' command to this GROWI.`).status(403);
   }
   }
 
 
   async function checkInteractionsPermission(req, res, next) {
   async function checkInteractionsPermission(req, res, next) {