aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/account/user.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/models/account/user.ts')
-rw-r--r--server/models/account/user.ts12
1 files changed, 7 insertions, 5 deletions
diff --git a/server/models/account/user.ts b/server/models/account/user.ts
index b2cd25bc3..3a339b5c3 100644
--- a/server/models/account/user.ts
+++ b/server/models/account/user.ts
@@ -583,16 +583,18 @@ export class UserModel extends Model<UserModel> {
583 } 583 }
584 584
585 canGetVideo (video: MVideoFullLight) { 585 canGetVideo (video: MVideoFullLight) {
586 if (video.privacy === VideoPrivacy.INTERNAL) return true 586 const videoUserId = video.VideoChannel.Account.userId
587 587
588 if (video.privacy === VideoPrivacy.PRIVATE) { 588 if (video.isBlacklisted()) {
589 return video.VideoChannel && video.VideoChannel.Account.userId === this.id 589 return videoUserId === this.id || this.hasRight(UserRight.MANAGE_VIDEO_BLACKLIST)
590 } 590 }
591 591
592 if (video.isBlacklisted()) { 592 if (video.privacy === VideoPrivacy.PRIVATE) {
593 return this.hasRight(UserRight.MANAGE_VIDEO_BLACKLIST) 593 return video.VideoChannel && videoUserId === this.id || this.hasRight(UserRight.MANAGE_VIDEO_BLACKLIST)
594 } 594 }
595 595
596 if (video.privacy === VideoPrivacy.INTERNAL) return true
597
596 return false 598 return false
597 } 599 }
598 600