MVideoImmutable,
MVideoThumbnail,
MVideoWithRights
-} from '@server/typings/models'
+} from '@server/types/models'
import { VideoFileModel } from '@server/models/video/video-file'
async function doesVideoExist (id: number | string, res: Response, fetchType: VideoFetchType = 'all') {
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()