aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/user-right.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-07-24 15:05:51 +0200
committerChocobozzz <chocobozzz@cpy.re>2020-07-31 11:35:19 +0200
commitedbc9325462ddf4536775871ebc25e06f46612d1 (patch)
tree9671dd51303e75d48d4f4f9a1df7a1960e33780d /server/middlewares/user-right.ts
parent20516920d2b72c8a18bc24b9740f7176aa962da2 (diff)
downloadPeerTube-edbc9325462ddf4536775871ebc25e06f46612d1.tar.gz
PeerTube-edbc9325462ddf4536775871ebc25e06f46612d1.tar.zst
PeerTube-edbc9325462ddf4536775871ebc25e06f46612d1.zip
Add server API to abuse messages
Diffstat (limited to 'server/middlewares/user-right.ts')
-rw-r--r--server/middlewares/user-right.ts6
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()