aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/users/user.model.ts
blob: b775cb8e7bc08c6321920907e4708a4fc0f1a18a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
export class User {
  id: string;
  username: string;
  role: string;
  createdDate: Date;

  constructor(hash: { id: string, username: string, role: string, createdDate: Date }) {
    this.id = hash.id;
    this.username = hash.username;
    this.role = hash.role;
    this.createdDate = hash.createdDate;
  }

  isAdmin() {
    return this.role === 'admin';
  }
}