From 68b6fd21b19ef17274e84dbb21ad7cfb7bc6c36a Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 21 Apr 2020 09:01:39 +0200 Subject: Don't leak unlisted videos in comments feed --- server/models/video/video-comment.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'server/models') diff --git a/server/models/video/video-comment.ts b/server/models/video/video-comment.ts index b33c33d5e..aedd7a3a9 100644 --- a/server/models/video/video-comment.ts +++ b/server/models/video/video-comment.ts @@ -27,6 +27,7 @@ import { MCommentOwnerVideoReply } from '../../typings/models/video' import { MUserAccountId } from '@server/typings/models' +import { VideoPrivacy } from '@shared/models' enum ScopeNames { WITH_ACCOUNT = 'WITH_ACCOUNT', @@ -390,7 +391,10 @@ export class VideoCommentModel extends Model { { attributes: [ 'name', 'uuid' ], model: VideoModel.unscoped(), - required: true + required: true, + where: { + privacy: VideoPrivacy.PUBLIC + } } ] } -- cgit v1.2.3