videosHistoryEnabled: boolean
videoLanguages: string[]
- role: UserRole
- roleLabel: string
+ role: {
+ id: UserRole
+ label: string
+ }
videoQuota: number
videoQuotaDaily: number
lastLoginDate: Date | null
+ twoFactorEnabled: boolean
+
createdAt: Date
constructor (hash: Partial<UserServerModel>) {
this.notificationSettings = hash.notificationSettings
+ this.twoFactorEnabled = hash.twoFactorEnabled
+
this.createdAt = hash.createdAt
this.pluginAuth = hash.pluginAuth
}
hasRight (right: UserRight) {
- return hasUserRight(this.role, right)
+ return hasUserRight(this.role.id, right)
}
patch (obj: UserServerModel) {
isAutoBlocked (serverConfig: HTMLServerConfig) {
if (serverConfig.autoBlacklist.videos.ofUsers.enabled !== true) return false
- return this.role === UserRole.USER && this.adminFlags !== UserAdminFlag.BYPASS_VIDEO_AUTO_BLACKLIST
+ return this.role.id === UserRole.USER && this.adminFlags !== UserAdminFlag.BYPASS_VIDEO_AUTO_BLACKLIST
}
}