aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/middlewares
diff options
context:
space:
mode:
Diffstat (limited to 'server/helpers/middlewares')
-rw-r--r--server/helpers/middlewares/videos.ts4
1 files changed, 2 insertions, 2 deletions
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
92 return true 92 return true
93} 93}
94 94
95function checkUserCanManageVideo (user: MUser, video: MVideoAccountLight, right: UserRight, res: Response) { 95function checkUserCanManageVideo (user: MUser, video: MVideoAccountLight, right: UserRight, res: Response, onlyOwned = true) {
96 // Retrieve the user who did the request 96 // Retrieve the user who did the request
97 if (video.isOwned() === false) { 97 if (onlyOwned && video.isOwned() === false) {
98 res.status(403) 98 res.status(403)
99 .json({ error: 'Cannot manage a video of another server.' }) 99 .json({ error: 'Cannot manage a video of another server.' })
100 .end() 100 .end()