1
0
Fork 0
mirror of synced 2024-06-27 02:20:35 +12:00
budibase/packages/backend-core/src/middleware/builderOnly.js

10 lines
211 B
JavaScript
Raw Normal View History

2022-02-10 12:16:24 +13:00
module.exports = async (ctx, next) => {
if (
!ctx.internal &&
(!ctx.user || !ctx.user.builder || !ctx.user.builder.global)
) {
ctx.throw(403, "Builder user only endpoint.")
}
return next()
}