aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/users/user.model.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/shared/users/user.model.ts')
-rw-r--r--client/src/app/shared/users/user.model.ts15
1 files changed, 15 insertions, 0 deletions
diff --git a/client/src/app/shared/users/user.model.ts b/client/src/app/shared/users/user.model.ts
new file mode 100644
index 000000000..0f34d4480
--- /dev/null
+++ b/client/src/app/shared/users/user.model.ts
@@ -0,0 +1,15 @@
1export class User {
2 id: string;
3 username: string;
4 role: string;
5
6 constructor(hash: { id: string, username: string, role: string }) {
7 this.id = hash.id;
8 this.username = hash.username;
9 this.role = hash.role;
10 }
11
12 isAdmin() {
13 return this.role === 'admin';
14 }
15}