diff options
Diffstat (limited to 'server/models')
-rw-r--r-- | server/models/account/user.ts | 4 | ||||
-rw-r--r-- | server/models/video/video-blacklist.ts | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/server/models/account/user.ts b/server/models/account/user.ts index 4ea175583..fbd3080c6 100644 --- a/server/models/account/user.ts +++ b/server/models/account/user.ts | |||
@@ -739,11 +739,11 @@ export class UserModel extends Model<UserModel> { | |||
739 | const videoUserId = video.VideoChannel.Account.userId | 739 | const videoUserId = video.VideoChannel.Account.userId |
740 | 740 | ||
741 | if (video.isBlacklisted()) { | 741 | if (video.isBlacklisted()) { |
742 | return videoUserId === this.id || this.hasRight(UserRight.MANAGE_VIDEO_BLOCKS) | 742 | return videoUserId === this.id || this.hasRight(UserRight.MANAGE_VIDEO_BLACKLIST) |
743 | } | 743 | } |
744 | 744 | ||
745 | if (video.privacy === VideoPrivacy.PRIVATE) { | 745 | if (video.privacy === VideoPrivacy.PRIVATE) { |
746 | return video.VideoChannel && videoUserId === this.id || this.hasRight(UserRight.MANAGE_VIDEO_BLOCKS) | 746 | return video.VideoChannel && videoUserId === this.id || this.hasRight(UserRight.MANAGE_VIDEO_BLACKLIST) |
747 | } | 747 | } |
748 | 748 | ||
749 | if (video.privacy === VideoPrivacy.INTERNAL) return true | 749 | if (video.privacy === VideoPrivacy.INTERNAL) return true |
diff --git a/server/models/video/video-blacklist.ts b/server/models/video/video-blacklist.ts index 70a6ecb03..8cbfe362e 100644 --- a/server/models/video/video-blacklist.ts +++ b/server/models/video/video-blacklist.ts | |||
@@ -3,7 +3,7 @@ import { getBlacklistSort, SortType, throwIfNotValid, searchAttribute } from '.. | |||
3 | import { VideoModel } from './video' | 3 | import { VideoModel } from './video' |
4 | import { ScopeNames as VideoChannelScopeNames, SummaryOptions, VideoChannelModel } from './video-channel' | 4 | import { ScopeNames as VideoChannelScopeNames, SummaryOptions, VideoChannelModel } from './video-channel' |
5 | import { isVideoBlacklistReasonValid, isVideoBlacklistTypeValid } from '../../helpers/custom-validators/video-blacklist' | 5 | import { isVideoBlacklistReasonValid, isVideoBlacklistTypeValid } from '../../helpers/custom-validators/video-blacklist' |
6 | import { VideoBlocklist, VideoBlockType } from '../../../shared/models/videos' | 6 | import { VideoBlacklist, VideoBlacklistType } from '../../../shared/models/videos' |
7 | import { CONSTRAINTS_FIELDS } from '../../initializers/constants' | 7 | import { CONSTRAINTS_FIELDS } from '../../initializers/constants' |
8 | import { FindOptions } from 'sequelize' | 8 | import { FindOptions } from 'sequelize' |
9 | import { ThumbnailModel } from './thumbnail' | 9 | import { ThumbnailModel } from './thumbnail' |
@@ -34,7 +34,7 @@ export class VideoBlacklistModel extends Model<VideoBlacklistModel> { | |||
34 | @Default(null) | 34 | @Default(null) |
35 | @Is('VideoBlacklistType', value => throwIfNotValid(value, isVideoBlacklistTypeValid, 'type')) | 35 | @Is('VideoBlacklistType', value => throwIfNotValid(value, isVideoBlacklistTypeValid, 'type')) |
36 | @Column | 36 | @Column |
37 | type: VideoBlockType | 37 | type: VideoBlacklistType |
38 | 38 | ||
39 | @CreatedAt | 39 | @CreatedAt |
40 | createdAt: Date | 40 | createdAt: Date |
@@ -59,7 +59,7 @@ export class VideoBlacklistModel extends Model<VideoBlacklistModel> { | |||
59 | count: number | 59 | count: number |
60 | sort: SortType | 60 | sort: SortType |
61 | search?: string | 61 | search?: string |
62 | type?: VideoBlockType | 62 | type?: VideoBlacklistType |
63 | }) { | 63 | }) { |
64 | const { start, count, sort, search, type } = parameters | 64 | const { start, count, sort, search, type } = parameters |
65 | 65 | ||
@@ -119,7 +119,7 @@ export class VideoBlacklistModel extends Model<VideoBlacklistModel> { | |||
119 | return VideoBlacklistModel.findOne(query) | 119 | return VideoBlacklistModel.findOne(query) |
120 | } | 120 | } |
121 | 121 | ||
122 | toFormattedJSON (this: MVideoBlacklistFormattable): VideoBlocklist { | 122 | toFormattedJSON (this: MVideoBlacklistFormattable): VideoBlacklist { |
123 | return { | 123 | return { |
124 | id: this.id, | 124 | id: this.id, |
125 | createdAt: this.createdAt, | 125 | createdAt: this.createdAt, |