]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/helpers/middlewares/videos.ts
hls-plugin: destroy hls upon third err
[github/Chocobozzz/PeerTube.git] / server / helpers / middlewares / videos.ts
index 77a48a46720a0f2ded170c9277c85357f91a2015..3904f762aba6abbecf45eb34acb60a1e8c113ba5 100644 (file)
@@ -92,9 +92,9 @@ async function doesVideoChannelOfAccountExist (channelId: number, user: MUserAcc
   return true
 }
 
-function checkUserCanManageVideo (user: MUser, video: MVideoAccountLight, right: UserRight, res: Response) {
+function checkUserCanManageVideo (user: MUser, video: MVideoAccountLight, right: UserRight, res: Response, onlyOwned = true) {
   // Retrieve the user who did the request
-  if (video.isOwned() === false) {
+  if (onlyOwned && video.isOwned() === false) {
     res.status(403)
        .json({ error: 'Cannot manage a video of another server.' })
        .end()