chore(xo-server/api): add expected permission to unauthorized error

This commit is contained in:
Julien Fontanet
2018-11-12 17:03:55 +01:00
parent a3dcdc4fd5
commit b39eb0f60d

View File

@@ -82,7 +82,7 @@ function checkPermission (method) {
const { user } = this
if (!user) {
throw errors.unauthorized()
throw errors.unauthorized(permission)
}
// The only requirement is login.
@@ -91,7 +91,7 @@ function checkPermission (method) {
}
if (!hasPermission(user, permission)) {
throw errors.unauthorized()
throw errors.unauthorized(permission)
}
}