From 954605a804da399317ca62afa2fb9244afa11ebf Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 27 Oct 2017 16:55:03 +0200 Subject: Support roles with rights and add moderator role --- client/src/app/shared/users/user.model.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'client/src/app/shared/users/user.model.ts') diff --git a/client/src/app/shared/users/user.model.ts b/client/src/app/shared/users/user.model.ts index 7beea5910..d738899ab 100644 --- a/client/src/app/shared/users/user.model.ts +++ b/client/src/app/shared/users/user.model.ts @@ -1,7 +1,9 @@ import { User as UserServerModel, UserRole, - VideoChannel + VideoChannel, + UserRight, + hasUserRight } from '../../../../../shared' export type UserConstructorHash = { @@ -56,7 +58,7 @@ export class User implements UserServerModel { } } - isAdmin () { - return this.role === 'admin' + hasRight (right: UserRight) { + return hasUserRight(this.role, right) } } -- cgit v1.2.3