Return HTTP 403 if user is not allowed to perform an operation

This commit is contained in:
Konstantin Tsabolov 2018-05-10 19:36:15 +02:00
parent 3056a7f18f
commit 9e897bcfda

View File

@ -39,7 +39,7 @@ module.exports = async (ctx, next) => {
}, []);
if (!permission) {
ctx.unauthorized();
ctx.forbidden();
return ctx.request.graphql = ctx.body;
}