diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-08-04 22:32:36 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-08-04 22:33:38 +0200 |
commit | 9bd2662976a75d3b03364cdbe6419e57c80f99a6 (patch) | |
tree | 0b5289660f843a8ba7f13aa79d458f53c94b36d9 /server/controllers/api/v1/pods.js | |
parent | e4c556196d7b31111f17596840d2e1d60caa7dcb (diff) | |
download | PeerTube-9bd2662976a75d3b03364cdbe6419e57c80f99a6.tar.gz PeerTube-9bd2662976a75d3b03364cdbe6419e57c80f99a6.tar.zst PeerTube-9bd2662976a75d3b03364cdbe6419e57c80f99a6.zip |
Implement user API (create, update, remove, list)
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 | ||