From f49b8d9b697f098490e81ce0afd889ba37dcb2f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Wed, 20 Jan 2021 23:40:40 +0100 Subject: Allow only admin to download a video --- client/src/app/shared/shared-main/video/video.model.ts | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'client/src/app/shared/shared-main/video/video.model.ts') 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 d51dfbc6d..fb00c11ff 100644 --- a/client/src/app/shared/shared-main/video/video.model.ts +++ b/client/src/app/shared/shared-main/video/video.model.ts @@ -179,6 +179,10 @@ export class Video implements VideoServerModel { return serverConfig.instance.defaultNSFWPolicy !== 'display' } + isDownloadableBy (user: AuthUser) { + return user && this.isLocal === true && user.hasRight(UserRight.SEE_ALL_VIDEOS) + } + isRemovableBy (user: AuthUser) { return user && this.isLocal === true && user.hasRight(UserRight.REMOVE_ANY_VIDEO) } -- cgit v1.2.3