hakumizuki 4 лет назад
Родитель
Сommit
db751e4919
1 измененных файлов с 14 добавлено и 0 удалено
  1. 14 0
      packages/app/src/server/routes/apiv3/slack-integration.js

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

@@ -11,6 +11,17 @@ const router = express.Router();
 const SlackAppIntegration = mongoose.model('SlackAppIntegration');
 const { respondIfSlackbotError } = require('../../service/slack-command-handler/respond-if-slackbot-error');
 
+// MOCK DATA DELETE THIS
+const MOCK_OBJECT_SLACKAPP_INTEGRATION = {
+  supportedCommandsForBroadcastUse: ['search'],
+  supportedCommandsForSingleUse: ['create', 'togetter'],
+  permittedChannels: {
+    search: ['admin'],
+    create: ['admin'],
+    togetter: ['admin'],
+  },
+};
+
 module.exports = (crowi) => {
   this.app = crowi.express;
 
@@ -90,6 +101,9 @@ module.exports = (crowi) => {
       return res.status(403).send(`It is not allowed to run '${command}' command to this GROWI.`);
     }
 
+    // validate using permittedChannels column
+
+
     next();
   }