From af4ae64f6faf38f8179f2e07d3cd4ad60006be92 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 2 Nov 2020 15:43:44 +0100 Subject: Begin live tests --- server/helpers/middlewares/videos.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'server/helpers/middlewares/videos.ts') diff --git a/server/helpers/middlewares/videos.ts b/server/helpers/middlewares/videos.ts index 77a48a467..3904f762a 100644 --- a/server/helpers/middlewares/videos.ts +++ b/server/helpers/middlewares/videos.ts @@ -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() -- cgit v1.2.3