diff options
Diffstat (limited to 'server/middlewares/user-right.ts')
-rw-r--r-- | server/middlewares/user-right.ts | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/server/middlewares/user-right.ts b/server/middlewares/user-right.ts index 4da7b9802..4d836485c 100644 --- a/server/middlewares/user-right.ts +++ b/server/middlewares/user-right.ts | |||
@@ -9,11 +9,7 @@ function ensureUserHasRight (userRight: UserRight) { | |||
9 | const message = `User ${user.username} does not have right ${UserRight[userRight]} to access to ${req.path}.` | 9 | const message = `User ${user.username} does not have right ${UserRight[userRight]} to access to ${req.path}.` |
10 | logger.info(message) | 10 | logger.info(message) |
11 | 11 | ||
12 | return res.status(403) | 12 | return res.status(403).json({ error: message }) |
13 | .json({ | ||
14 | error: message | ||
15 | }) | ||
16 | .end() | ||
17 | } | 13 | } |
18 | 14 | ||
19 | return next() | 15 | return next() |