diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-11-14 09:11:43 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-11-27 19:40:51 +0100 |
commit | 8e6964874990d5ee9d3703be71c6ab4617b9ce20 (patch) | |
tree | 84f45507c425d8b64ba03292cb9d49a4feaadeba /server/controllers/api | |
parent | ce548a10db3822c415b30ea0edb59e02a460734a (diff) | |
download | PeerTube-8e6964874990d5ee9d3703be71c6ab4617b9ce20.tar.gz PeerTube-8e6964874990d5ee9d3703be71c6ab4617b9ce20.tar.zst PeerTube-8e6964874990d5ee9d3703be71c6ab4617b9ce20.zip |
Add MANAGE_PEERTUBE_FOLLOW right
Diffstat (limited to 'server/controllers/api')
-rw-r--r-- | server/controllers/api/pods.ts | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/server/controllers/api/pods.ts b/server/controllers/api/pods.ts index f662f1c03..2231a05fa 100644 --- a/server/controllers/api/pods.ts +++ b/server/controllers/api/pods.ts | |||
@@ -11,6 +11,9 @@ import { setFollowingSort } from '../../middlewares/sort' | |||
11 | import { followValidator } from '../../middlewares/validators/pods' | 11 | import { followValidator } from '../../middlewares/validators/pods' |
12 | import { followersSortValidator, followingSortValidator } from '../../middlewares/validators/sort' | 12 | import { followersSortValidator, followingSortValidator } from '../../middlewares/validators/sort' |
13 | import { sendFollow } from '../../lib/activitypub/send-request' | 13 | import { sendFollow } from '../../lib/activitypub/send-request' |
14 | import { authenticate } from '../../middlewares/oauth' | ||
15 | import { ensureUserHasRight } from '../../middlewares/user-right' | ||
16 | import { UserRight } from '../../../shared/models/users/user-right.enum' | ||
14 | 17 | ||
15 | const podsRouter = express.Router() | 18 | const podsRouter = express.Router() |
16 | 19 | ||
@@ -23,6 +26,8 @@ podsRouter.get('/following', | |||
23 | ) | 26 | ) |
24 | 27 | ||
25 | podsRouter.post('/follow', | 28 | podsRouter.post('/follow', |
29 | authenticate, | ||
30 | ensureUserHasRight(UserRight.MANAGE_PEERTUBE_FOLLOW), | ||
26 | followValidator, | 31 | followValidator, |
27 | setBodyHostsPort, | 32 | setBodyHostsPort, |
28 | asyncMiddleware(follow) | 33 | asyncMiddleware(follow) |