aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/videos/shared
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/videos/shared')
-rw-r--r--client/src/app/videos/shared/video.model.ts8
-rw-r--r--client/src/app/videos/shared/video.service.ts6
2 files changed, 12 insertions, 2 deletions
diff --git a/client/src/app/videos/shared/video.model.ts b/client/src/app/videos/shared/video.model.ts
index 404e3bf45..1cfb312b6 100644
--- a/client/src/app/videos/shared/video.model.ts
+++ b/client/src/app/videos/shared/video.model.ts
@@ -85,8 +85,12 @@ export class Video {
85 this.by = Video.createByString(hash.author, hash.podHost); 85 this.by = Video.createByString(hash.author, hash.podHost);
86 } 86 }
87 87
88 isRemovableBy(user: User) { 88 isRemovableBy(user) {
89 return this.isLocal === true && user && this.author === user.username; 89 return user && this.isLocal === true && (this.author === user.username || user.isAdmin() === true);
90 }
91
92 isBlackistableBy(user) {
93 return user && user.isAdmin() === true && this.isLocal === false;
90 } 94 }
91 95
92 isVideoNSFWForUser(user: User) { 96 isVideoNSFWForUser(user: User) {
diff --git a/client/src/app/videos/shared/video.service.ts b/client/src/app/videos/shared/video.service.ts
index ee67bc1ae..a0965e20c 100644
--- a/client/src/app/videos/shared/video.service.ts
+++ b/client/src/app/videos/shared/video.service.ts
@@ -150,6 +150,12 @@ export class VideoService {
150 .catch((res) => this.restExtractor.handleError(res)); 150 .catch((res) => this.restExtractor.handleError(res));
151 } 151 }
152 152
153 blacklistVideo(id: string) {
154 return this.authHttp.post(VideoService.BASE_VIDEO_URL + id + '/blacklist', {})
155 .map(this.restExtractor.extractDataBool)
156 .catch((res) => this.restExtractor.handleError(res));
157 }
158
153 private setVideoRate(id: string, rateType: RateType) { 159 private setVideoRate(id: string, rateType: RateType) {
154 const url = VideoService.BASE_VIDEO_URL + id + '/rate'; 160 const url = VideoService.BASE_VIDEO_URL + id + '/rate';
155 const body = { 161 const body = {