diff options
author | Chocobozzz <me@florianbigard.com> | 2020-11-02 15:43:44 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2020-11-09 15:33:04 +0100 |
commit | af4ae64f6faf38f8179f2e07d3cd4ad60006be92 (patch) | |
tree | a2d39ddc138d49619f03f11e003c2302f824286c /server/helpers/middlewares | |
parent | 77e9f859c6ad75ba179dec74e5410cc651eaa49b (diff) | |
download | PeerTube-af4ae64f6faf38f8179f2e07d3cd4ad60006be92.tar.gz PeerTube-af4ae64f6faf38f8179f2e07d3cd4ad60006be92.tar.zst PeerTube-af4ae64f6faf38f8179f2e07d3cd4ad60006be92.zip |
Begin live tests
Diffstat (limited to 'server/helpers/middlewares')
-rw-r--r-- | server/helpers/middlewares/videos.ts | 4 |
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 | ||
95 | function checkUserCanManageVideo (user: MUser, video: MVideoAccountLight, right: UserRight, res: Response) { | 95 | function 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() |