aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/videos/files.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/api/videos/files.ts')
-rw-r--r--server/controllers/api/videos/files.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/server/controllers/api/videos/files.ts b/server/controllers/api/videos/files.ts
index 2fe4b5a3f..a8b32411d 100644
--- a/server/controllers/api/videos/files.ts
+++ b/server/controllers/api/videos/files.ts
@@ -3,10 +3,11 @@ import toInt from 'validator/lib/toInt'
3import { logger, loggerTagsFactory } from '@server/helpers/logger' 3import { logger, loggerTagsFactory } from '@server/helpers/logger'
4import { federateVideoIfNeeded } from '@server/lib/activitypub/videos' 4import { federateVideoIfNeeded } from '@server/lib/activitypub/videos'
5import { VideoFileModel } from '@server/models/video/video-file' 5import { VideoFileModel } from '@server/models/video/video-file'
6import { HttpStatusCode } from '@shared/models' 6import { HttpStatusCode, UserRight } from '@shared/models'
7import { 7import {
8 asyncMiddleware, 8 asyncMiddleware,
9 authenticate, 9 authenticate,
10 ensureUserHasRight,
10 videoFileMetadataGetValidator, 11 videoFileMetadataGetValidator,
11 videoFilesDeleteHLSValidator, 12 videoFilesDeleteHLSValidator,
12 videoFilesDeleteWebTorrentValidator 13 videoFilesDeleteWebTorrentValidator
@@ -22,12 +23,14 @@ filesRouter.get('/:id/metadata/:videoFileId',
22 23
23filesRouter.delete('/:id/hls', 24filesRouter.delete('/:id/hls',
24 authenticate, 25 authenticate,
26 ensureUserHasRight(UserRight.MANAGE_VIDEO_FILES),
25 asyncMiddleware(videoFilesDeleteHLSValidator), 27 asyncMiddleware(videoFilesDeleteHLSValidator),
26 asyncMiddleware(removeHLSPlaylist) 28 asyncMiddleware(removeHLSPlaylist)
27) 29)
28 30
29filesRouter.delete('/:id/webtorrent', 31filesRouter.delete('/:id/webtorrent',
30 authenticate, 32 authenticate,
33 ensureUserHasRight(UserRight.MANAGE_VIDEO_FILES),
31 asyncMiddleware(videoFilesDeleteWebTorrentValidator), 34 asyncMiddleware(videoFilesDeleteWebTorrentValidator),
32 asyncMiddleware(removeWebTorrentFiles) 35 asyncMiddleware(removeWebTorrentFiles)
33) 36)