From 8e6964874990d5ee9d3703be71c6ab4617b9ce20 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 14 Nov 2017 09:11:43 +0100 Subject: Add MANAGE_PEERTUBE_FOLLOW right --- server/controllers/api/pods.ts | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'server/controllers/api') 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' import { followValidator } from '../../middlewares/validators/pods' import { followersSortValidator, followingSortValidator } from '../../middlewares/validators/sort' import { sendFollow } from '../../lib/activitypub/send-request' +import { authenticate } from '../../middlewares/oauth' +import { ensureUserHasRight } from '../../middlewares/user-right' +import { UserRight } from '../../../shared/models/users/user-right.enum' const podsRouter = express.Router() @@ -23,6 +26,8 @@ podsRouter.get('/following', ) podsRouter.post('/follow', + authenticate, + ensureUserHasRight(UserRight.MANAGE_PEERTUBE_FOLLOW), followValidator, setBodyHostsPort, asyncMiddleware(follow) -- cgit v1.2.3