First version with PostgreSQL
[oweals/peertube.git] / client / src / app / shared / users / user.model.ts
1 export class User {
2   id: number;
3   username: string;
4   role: string;
5   createdAt: Date;
6
7   constructor(hash: { id: number, username: string, role: string, createdAt?: Date }) {
8     this.id = hash.id;
9     this.username = hash.username;
10     this.role = hash.role;
11
12     if (hash.createdAt) {
13       this.createdAt = hash.createdAt;
14     }
15   }
16
17   isAdmin() {
18     return this.role === 'admin';
19   }
20 }