aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/admin.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-04-26 21:42:36 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-04-26 21:42:36 +0200
commitab683a8e0d998cfd9dfb9562d3c616f3e6e1dbfd (patch)
tree8f6d77c733b56a3778156eb717b188a1addc7676 /server/middlewares/admin.js
parent32502eda29f67ef111391d751f61132f8103fda8 (diff)
downloadPeerTube-ab683a8e0d998cfd9dfb9562d3c616f3e6e1dbfd.tar.gz
PeerTube-ab683a8e0d998cfd9dfb9562d3c616f3e6e1dbfd.tar.zst
PeerTube-ab683a8e0d998cfd9dfb9562d3c616f3e6e1dbfd.zip
Format video blacklist
Diffstat (limited to 'server/middlewares/admin.js')
-rw-r--r--server/middlewares/admin.js3
1 files changed, 1 insertions, 2 deletions
diff --git a/server/middlewares/admin.js b/server/middlewares/admin.js
index e6d9dc887..3288f4c6b 100644
--- a/server/middlewares/admin.js
+++ b/server/middlewares/admin.js
@@ -1,6 +1,5 @@
1'use strict' 1'use strict'
2 2
3const constants = require('../initializers/constants')
4const logger = require('../helpers/logger') 3const logger = require('../helpers/logger')
5 4
6const adminMiddleware = { 5const adminMiddleware = {
@@ -9,7 +8,7 @@ const adminMiddleware = {
9 8
10function ensureIsAdmin (req, res, next) { 9function ensureIsAdmin (req, res, next) {
11 const user = res.locals.oauth.token.user 10 const user = res.locals.oauth.token.user
12 if (user.role !== constants.USER_ROLES.ADMIN) { 11 if (user.isAdmin() === false) {
13 logger.info('A non admin user is trying to access to an admin content.') 12 logger.info('A non admin user is trying to access to an admin content.')
14 return res.sendStatus(403) 13 return res.sendStatus(403)
15 } 14 }