aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-12-18 16:38:39 +0100
committerChocobozzz <me@florianbigard.com>2019-12-18 16:47:54 +0100
commit2a5518a667ef219e560214cdecd03a45d96aa6b1 (patch)
tree881d71c1559128015b10e1a79d6fa6eccfe4781a /server/models
parent09033f7aa35c32b4d9acb6a92902e4a8f00d5201 (diff)
downloadPeerTube-2a5518a667ef219e560214cdecd03a45d96aa6b1.tar.gz
PeerTube-2a5518a667ef219e560214cdecd03a45d96aa6b1.tar.zst
PeerTube-2a5518a667ef219e560214cdecd03a45d96aa6b1.zip
Fix lint & tests
Diffstat (limited to 'server/models')
-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