diff options
author | Chocobozzz <me@florianbigard.com> | 2018-02-22 09:03:45 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-02-22 09:03:45 +0100 |
commit | 6221f311de0eb8f2a9e7e4a77b8cb0ecbde6dfcd (patch) | |
tree | 895e833221877e5f2c4bf291a7cd1bda05cf8865 /client/src/app | |
parent | 9f4183c9b57acd382668d49e86b0001bcd55550f (diff) | |
download | PeerTube-6221f311de0eb8f2a9e7e4a77b8cb0ecbde6dfcd.tar.gz PeerTube-6221f311de0eb8f2a9e7e4a77b8cb0ecbde6dfcd.tar.zst PeerTube-6221f311de0eb8f2a9e7e4a77b8cb0ecbde6dfcd.zip |
Add ability to update another user video
Diffstat (limited to 'client/src/app')
-rw-r--r-- | client/src/app/shared/video/video-details.model.ts | 2 | ||||
-rw-r--r-- | client/src/app/videos/+video-edit/video-update.component.ts | 10 |
2 files changed, 8 insertions, 4 deletions
diff --git a/client/src/app/shared/video/video-details.model.ts b/client/src/app/shared/video/video-details.model.ts index 4e4f64c7b..a22ed68da 100644 --- a/client/src/app/shared/video/video-details.model.ts +++ b/client/src/app/shared/video/video-details.model.ts | |||
@@ -88,6 +88,6 @@ export class VideoDetails extends Video implements VideoDetailsServerModel { | |||
88 | } | 88 | } |
89 | 89 | ||
90 | isUpdatableBy (user: AuthUser) { | 90 | isUpdatableBy (user: AuthUser) { |
91 | return user && this.isLocal === true && user.username === this.accountName | 91 | return user && this.isLocal === true && (this.accountName === user.username || user.hasRight(UserRight.UPDATE_ANY_VIDEO)) |
92 | } | 92 | } |
93 | } | 93 | } |
diff --git a/client/src/app/videos/+video-edit/video-update.component.ts b/client/src/app/videos/+video-edit/video-update.component.ts index d97e00a3a..2fc09278c 100644 --- a/client/src/app/videos/+video-edit/video-update.component.ts +++ b/client/src/app/videos/+video-edit/video-update.component.ts | |||
@@ -53,9 +53,6 @@ export class VideoUpdateComponent extends FormReactive implements OnInit { | |||
53 | this.serverService.videoPrivaciesLoaded | 53 | this.serverService.videoPrivaciesLoaded |
54 | .subscribe(() => this.videoPrivacies = this.serverService.getVideoPrivacies()) | 54 | .subscribe(() => this.videoPrivacies = this.serverService.getVideoPrivacies()) |
55 | 55 | ||
56 | populateAsyncUserVideoChannels(this.authService, this.userVideoChannels) | ||
57 | .catch(err => console.error('Cannot populate async user video channels.', err)) | ||
58 | |||
59 | const uuid: string = this.route.snapshot.params['uuid'] | 56 | const uuid: string = this.route.snapshot.params['uuid'] |
60 | this.videoService.getVideo(uuid) | 57 | this.videoService.getVideo(uuid) |
61 | .switchMap(video => { | 58 | .switchMap(video => { |
@@ -67,6 +64,13 @@ export class VideoUpdateComponent extends FormReactive implements OnInit { | |||
67 | video => { | 64 | video => { |
68 | this.video = new VideoEdit(video) | 65 | this.video = new VideoEdit(video) |
69 | 66 | ||
67 | this.userVideoChannels = [ | ||
68 | { | ||
69 | id: video.channel.id, | ||
70 | label: video.channel.displayName | ||
71 | } | ||
72 | ] | ||
73 | |||
70 | // We cannot set private a video that was not private | 74 | // We cannot set private a video that was not private |
71 | if (video.privacy !== VideoPrivacy.PRIVATE) { | 75 | if (video.privacy !== VideoPrivacy.PRIVATE) { |
72 | const newVideoPrivacies = [] | 76 | const newVideoPrivacies = [] |