diff options
Diffstat (limited to 'server/helpers/custom-validators/video-ownership.ts')
-rw-r--r-- | server/helpers/custom-validators/video-ownership.ts | 20 |
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 @@ | |||
1 | import { Response } from 'express' | ||
2 | import { MUserId } from '@server/types/models' | ||
3 | import { MVideoChangeOwnershipFull } from '@server/types/models/video/video-change-ownership' | ||
4 | import { HttpStatusCode } from '../../../shared/models/http/http-error-codes' | ||
5 | |||
6 | function 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 | |||
18 | export { | ||
19 | checkUserCanTerminateOwnershipChange | ||
20 | } | ||