You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
736 B
37 lines
736 B
/* eslint-disable import/prefer-default-export */ |
|
export class User { |
|
constructor(u) { |
|
this.id = u.id; |
|
this.displayName = u.displayName; |
|
this.displayColor = u.displayColor; |
|
this.createdAt = u.createdAt; |
|
this.previousNames = u.previousNames; |
|
this.nameChangedAt = u.nameChangedAt; |
|
this.scopes = u.scopes; |
|
this.authenticated = u.authenticated; |
|
} |
|
|
|
id: string; |
|
|
|
displayName: string; |
|
|
|
displayColor: number; |
|
|
|
createdAt: Date; |
|
|
|
previousNames: string[]; |
|
|
|
nameChangedAt: Date; |
|
|
|
scopes: string[]; |
|
|
|
authenticated: boolean; |
|
|
|
public isModerator = (): boolean => { |
|
if (!this.scopes || this.scopes.length === 0) { |
|
return false; |
|
} |
|
|
|
return this.scopes.includes('moderator'); |
|
}; |
|
}
|
|
|