diff options
Diffstat (limited to 'server/controllers/api/videos/files.ts')
-rw-r--r-- | server/controllers/api/videos/files.ts | 5 |
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' | |||
3 | import { logger, loggerTagsFactory } from '@server/helpers/logger' | 3 | import { logger, loggerTagsFactory } from '@server/helpers/logger' |
4 | import { federateVideoIfNeeded } from '@server/lib/activitypub/videos' | 4 | import { federateVideoIfNeeded } from '@server/lib/activitypub/videos' |
5 | import { VideoFileModel } from '@server/models/video/video-file' | 5 | import { VideoFileModel } from '@server/models/video/video-file' |
6 | import { HttpStatusCode } from '@shared/models' | 6 | import { HttpStatusCode, UserRight } from '@shared/models' |
7 | import { | 7 | import { |
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 | ||
23 | filesRouter.delete('/:id/hls', | 24 | filesRouter.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 | ||
29 | filesRouter.delete('/:id/webtorrent', | 31 | filesRouter.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 | ) |