aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/custom-validators/video-ownership.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/helpers/custom-validators/video-ownership.ts')
-rw-r--r--server/helpers/custom-validators/video-ownership.ts20
1 files changed, 0 insertions, 20 deletions
diff --git a/server/helpers/custom-validators/video-ownership.ts b/server/helpers/custom-validators/video-ownership.ts
deleted file mode 100644
index cf15b385a..000000000
--- a/server/helpers/custom-validators/video-ownership.ts
+++ /dev/null
@@ -1,20 +0,0 @@
1import { Response } from 'express'
2import { MUserId } from '@server/types/models'
3import { MVideoChangeOwnershipFull } from '@server/types/models/video/video-change-ownership'
4import { HttpStatusCode } from '../../../shared/models/http/http-error-codes'
5
6function checkUserCanTerminateOwnershipChange (user: MUserId, videoChangeOwnership: MVideoChangeOwnershipFull, res: Response) {
7 if (videoChangeOwnership.NextOwner.userId === user.id) {
8 return true
9 }
10
11 res.fail({
12 status: HttpStatusCode.FORBIDDEN_403,
13 message: 'Cannot terminate an ownership change of another user'
14 })
15 return false
16}
17
18export {
19 checkUserCanTerminateOwnershipChange
20}