diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-08-09 21:45:21 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-08-09 21:45:21 +0200 |
commit | 7da18e4420c4b71a8ecfda07f39324fbfec081c3 (patch) | |
tree | 2755feedd730a78cdc407e7a79bcbfce3ebe71c8 /client/src/app/shared/users | |
parent | 68a3b9f2aacb0225ae8b883b561b144bac339cbd (diff) | |
download | PeerTube-7da18e4420c4b71a8ecfda07f39324fbfec081c3.tar.gz PeerTube-7da18e4420c4b71a8ecfda07f39324fbfec081c3.tar.zst PeerTube-7da18e4420c4b71a8ecfda07f39324fbfec081c3.zip |
Client: add user management
Diffstat (limited to 'client/src/app/shared/users')
-rw-r--r-- | client/src/app/shared/users/index.ts | 1 | ||||
-rw-r--r-- | client/src/app/shared/users/user.model.ts | 15 |
2 files changed, 16 insertions, 0 deletions
diff --git a/client/src/app/shared/users/index.ts b/client/src/app/shared/users/index.ts new file mode 100644 index 000000000..5a670ce8f --- /dev/null +++ b/client/src/app/shared/users/index.ts | |||
@@ -0,0 +1 @@ | |||
export * from './user.model'; | |||
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 @@ | |||
1 | export 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 | } | ||