Merge pull request #1217 from Budibase/bug/webhook-perm-fix

Webhook permissions fix
This commit is contained in:
Michael Drury 2021-02-27 12:59:43 +00:00 committed by GitHub
commit 167e60a334
1 changed files with 3 additions and 10 deletions

View File

@ -2,11 +2,7 @@ const Router = require("@koa/router")
const controller = require("../controllers/webhook")
const authorized = require("../../middleware/authorized")
const joiValidator = require("../../middleware/joi-validator")
const {
BUILDER,
PermissionTypes,
PermissionLevels,
} = require("../../utilities/security/permissions")
const { BUILDER } = require("../../utilities/security/permissions")
const Joi = require("joi")
const router = Router()
@ -40,10 +36,7 @@ router
authorized(BUILDER),
controller.buildSchema
)
.post(
"/api/webhooks/trigger/:instance/:id",
authorized(PermissionTypes.WEBHOOK, PermissionLevels.EXECUTE),
controller.trigger
)
// this shouldn't have authorisation, right now its always public
.post("/api/webhooks/trigger/:instance/:id", controller.trigger)
module.exports = router