diff options
Diffstat (limited to 'server/controllers/api/v1/pods.js')
-rw-r--r-- | server/controllers/api/v1/pods.js | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/server/controllers/api/v1/pods.js b/server/controllers/api/v1/pods.js index 2bc761fef..f61f2a483 100644 --- a/server/controllers/api/v1/pods.js +++ b/server/controllers/api/v1/pods.js | |||
@@ -8,6 +8,7 @@ const waterfall = require('async/waterfall') | |||
8 | const logger = require('../../../helpers/logger') | 8 | const logger = require('../../../helpers/logger') |
9 | const friends = require('../../../lib/friends') | 9 | const friends = require('../../../lib/friends') |
10 | const middlewares = require('../../../middlewares') | 10 | const middlewares = require('../../../middlewares') |
11 | const admin = middlewares.admin | ||
11 | const oAuth = middlewares.oauth | 12 | const oAuth = middlewares.oauth |
12 | const validators = middlewares.validators.pods | 13 | const validators = middlewares.validators.pods |
13 | const signatureValidator = middlewares.validators.remote.signature | 14 | const signatureValidator = middlewares.validators.remote.signature |
@@ -18,8 +19,17 @@ const Video = mongoose.model('Video') | |||
18 | 19 | ||
19 | router.get('/', listPodsUrl) | 20 | router.get('/', listPodsUrl) |
20 | router.post('/', validators.podsAdd, addPods) | 21 | router.post('/', validators.podsAdd, addPods) |
21 | router.get('/makefriends', oAuth.authenticate, validators.makeFriends, makeFriends) | 22 | router.get('/makefriends', |
22 | router.get('/quitfriends', oAuth.authenticate, quitFriends) | 23 | oAuth.authenticate, |
24 | admin.ensureIsAdmin, | ||
25 | validators.makeFriends, | ||
26 | makeFriends | ||
27 | ) | ||
28 | router.get('/quitfriends', | ||
29 | oAuth.authenticate, | ||
30 | admin.ensureIsAdmin, | ||
31 | quitFriends | ||
32 | ) | ||
23 | // Post because this is a secured request | 33 | // Post because this is a secured request |
24 | router.post('/remove', signatureValidator, removePods) | 34 | router.post('/remove', signatureValidator, removePods) |
25 | 35 | ||