Allow builders (not just admins) to delete apps.

This commit is contained in:
mike12345567 2022-08-04 17:14:52 +01:00
parent 39494beb80
commit a05e21ee4b
1 changed files with 4 additions and 4 deletions

View File

@ -1,12 +1,12 @@
const Router = require("@koa/router")
const controller = require("../../controllers/global/roles")
const { adminOnly } = require("@budibase/backend-core/auth")
const builderOrAdmin = require("../../../middleware/builderOrAdmin")
const router = Router()
router
.get("/api/global/roles", adminOnly, controller.fetch)
.get("/api/global/roles/:appId", adminOnly, controller.find)
.delete("/api/global/roles/:appId", adminOnly, controller.removeAppRole)
.get("/api/global/roles", builderOrAdmin, controller.fetch)
.get("/api/global/roles/:appId", builderOrAdmin, controller.find)
.delete("/api/global/roles/:appId", builderOrAdmin, controller.removeAppRole)
module.exports = router