Browse Source

Temporary code

hakumizuki 4 years ago
parent
commit
db751e4919
1 changed files with 14 additions and 0 deletions
  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 SlackAppIntegration = mongoose.model('SlackAppIntegration');
 const { respondIfSlackbotError } = require('../../service/slack-command-handler/respond-if-slackbot-error');
 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) => {
 module.exports = (crowi) => {
   this.app = crowi.express;
   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.`);
       return res.status(403).send(`It is not allowed to run '${command}' command to this GROWI.`);
     }
     }
 
 
+    // validate using permittedChannels column
+
+
     next();
     next();
   }
   }