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

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

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