2 User as UserServerModel,
5 } from '../../../../../shared'
7 export type UserConstructorHash = {
13 displayNSFW?: boolean,
19 videoChannels?: VideoChannel[]
21 export class User implements UserServerModel {
32 videoChannels: VideoChannel[]
35 constructor (hash: UserConstructorHash) {
37 this.username = hash.username
38 this.email = hash.email
40 this.author = hash.author
42 if (hash.videoChannels !== undefined) {
43 this.videoChannels = hash.videoChannels
46 if (hash.videoQuota !== undefined) {
47 this.videoQuota = hash.videoQuota
50 if (hash.displayNSFW !== undefined) {
51 this.displayNSFW = hash.displayNSFW
54 if (hash.createdAt !== undefined) {
55 this.createdAt = hash.createdAt
60 return this.role === 'admin'