]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/app/shared/users/user.model.ts
Server: Add NSFW in user profile
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / users / user.model.ts
CommitLineData
7da18e44 1export class User {
feb4bdfd 2 id: number;
7da18e44
C
3 username: string;
4 role: string;
feb4bdfd 5 createdAt: Date;
7da18e44 6
feb4bdfd 7 constructor(hash: { id: number, username: string, role: string, createdAt?: Date }) {
7da18e44
C
8 this.id = hash.id;
9 this.username = hash.username;
10 this.role = hash.role;
44c5275e 11
feb4bdfd
C
12 if (hash.createdAt) {
13 this.createdAt = hash.createdAt;
44c5275e 14 }
7da18e44
C
15 }
16
17 isAdmin() {
18 return this.role === 'admin';
19 }
20}