6 lines
173 B
JavaScript
6 lines
173 B
JavaScript
|
module.exports = async (ctx, next) => {
|
||
|
if (!ctx.user || !ctx.user.admin || !ctx.user.admin.global) {
|
||
|
ctx.throw(403, "Admin user only endpoint.")
|
||
|
}
|
||
|
return next()
|
||
|
}
|