aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/user-right.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-08-06 14:58:01 +0200
committerChocobozzz <chocobozzz@cpy.re>2020-08-07 08:28:14 +0200
commitbd45d503e5d007e730f4e81dccd7e7864c9a85cc (patch)
treeb78df768b8253ba401232c17da940cea016c9960 /server/middlewares/user-right.ts
parent583eb04b541175035d6d452ca626a96ebf2b7437 (diff)
downloadPeerTube-bd45d503e5d007e730f4e81dccd7e7864c9a85cc.tar.gz
PeerTube-bd45d503e5d007e730f4e81dccd7e7864c9a85cc.tar.zst
PeerTube-bd45d503e5d007e730f4e81dccd7e7864c9a85cc.zip
Reorganize shared models
Diffstat (limited to 'server/middlewares/user-right.ts')
-rw-r--r--server/middlewares/user-right.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/server/middlewares/user-right.ts b/server/middlewares/user-right.ts
index 4d836485c..aaf0b323a 100644
--- a/server/middlewares/user-right.ts
+++ b/server/middlewares/user-right.ts
@@ -6,7 +6,7 @@ function ensureUserHasRight (userRight: UserRight) {
6 return function (req: express.Request, res: express.Response, next: express.NextFunction) { 6 return function (req: express.Request, res: express.Response, next: express.NextFunction) {
7 const user = res.locals.oauth.token.user 7 const user = res.locals.oauth.token.user
8 if (user.hasRight(userRight) === false) { 8 if (user.hasRight(userRight) === false) {
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} to access to ${req.path}.`
10 logger.info(message) 10 logger.info(message)
11 11
12 return res.status(403).json({ error: message }) 12 return res.status(403).json({ error: message })