Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Fix watching password protected video as editor

Chocobozzzf0500bbcddd3
diff --git a/client/src/app/shared/shared-main/video/video.model.ts b/client/src/app/shared/shared-main/video/video.model.ts
index 7e61be97d3..473710d3fe 100644
--- a/client/src/app/shared/shared-main/video/video.model.ts
+++ b/client/src/app/shared/shared-main/video/video.model.ts
@@ -281,6 +281,25 @@ export class Video implements VideoServerModel {
)
}
+ canBypassPassword (user: AuthUser) {
+ return this.privacy.id === VideoPrivacy.PASSWORD_PROTECTED &&
+ user &&
+ this.isLocal === true && (
+ user.isOwnerOfChannel(this.channel) ||
+ user.isEditorOfChannel(this.channel) ||
+ user.hasRight(UserRight.SEE_ALL_VIDEOS)
+ )
+ }
+
+ isLiveInfoAvailableBy (user: AuthUser) {
+ return this.isLive &&
+ user && this.isLocal === true && (
+ user.isOwnerOfChannel(this.channel) ||
+ user.isEditorOfChannel(this.channel) ||
+ user.hasRight(UserRight.GET_ANY_LIVE)
+ )
+ }
+
// ---------------------------------------------------------------------------
canRemoveOneFile (user: AuthUser) {
@@ -300,6 +319,10 @@ export class Video implements VideoServerModel {
// ---------------------------------------------------------------------------
+ canBeDuplicatedBy (user: AuthUser) {
+ return user && this.isLocal === false && user.hasRight(UserRight.MANAGE_VIDEOS_REDUNDANCIES)
+ }
+
canRunTranscoding (user: AuthUser) {
return this.isLocal &&
!this.isLive &&
@@ -340,20 +363,4 @@ export class Video implements VideoServerModel {
getAllVideoFiles () {
return getAllFiles(this)
}
-
- isLiveInfoAvailableBy (user: AuthUser) {
- return this.isLive &&
- user && this.isLocal === true && (this.account.name === user.username || user.hasRight(UserRight.GET_ANY_LIVE))
- }
-
- canBeDuplicatedBy (user: AuthUser) {
- return user && this.isLocal === false && user.hasRight(UserRight.MANAGE_VIDEOS_REDUNDANCIES)
- }
-
- canBypassPassword (user: AuthUser) {
- return this.privacy.id === VideoPrivacy.PASSWORD_PROTECTED &&
- user &&
- this.isLocal === true &&
- (this.account.name === user.username || user.hasRight(UserRight.SEE_ALL_VIDEOS))
- }
}