multiple role management

This commit is contained in:
2020-04-25 15:32:53 +02:00
committed by smuddy
parent e17b8acc9c
commit 01d13ccea9
12 changed files with 99 additions and 42 deletions

View File

@@ -44,7 +44,7 @@ export class RoleDirective implements OnInit {
if (this.currentUser && this.currentUser.role) {
if (this.currentUser.role === 'admin') return true;
for (const role of this.appRole) {
if (this.currentUser.role === role) return true;
if (this.currentUser.role.indexOf(role) !== -1) return true;
}
}

View File

@@ -1,2 +1,2 @@
export type roles = 'none' | 'admin' | 'user' | 'leader' | 'presenter';
export const ROLE_TYPES: roles[] = ['none', 'admin', 'user', 'leader', 'presenter'];
export type roles = 'none' | 'admin' | 'user' | 'leader' | 'presenter' | 'distributor';
export const ROLE_TYPES: roles[] = ['admin', 'user', 'leader', 'presenter', 'distributor'];

View File

@@ -3,6 +3,6 @@ import {ChordMode} from '../../widget-modules/components/song-text/song-text.com
export interface User {
id: string;
name: string;
role: 'admin';
role: string;
chordMode: ChordMode
}