]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/middlewares/validators/feeds.ts
Add sync link to import page
[github/Chocobozzz/PeerTube.git] / server / middlewares / validators / feeds.ts
index f8ebaf6ed87d65cb360fe6465c56b625d3acd0ca..04b4e00c9c6a6b6f7b43346c433d0327a471843a 100644 (file)
@@ -6,6 +6,7 @@ import { exists, isIdOrUUIDValid, isIdValid, toCompleteUUID } from '../../helper
 import { logger } from '../../helpers/logger'
 import {
   areValidationErrors,
+  checkCanSeeVideo,
   doesAccountIdExist,
   doesAccountNameWithHostExist,
   doesUserFeedTokenCorrespond,
@@ -112,7 +113,10 @@ const videoCommentsFeedsValidator = [
       return res.fail({ message: 'videoId cannot be mixed with a channel filter' })
     }
 
-    if (req.query.videoId && !await doesVideoExist(req.query.videoId, res)) return
+    if (req.query.videoId) {
+      if (!await doesVideoExist(req.query.videoId, res)) return
+      if (!await checkCanSeeVideo({ req, res, paramId: req.query.videoId, video: res.locals.videoAll })) return
+    }
 
     return next()
   }