multiple role management
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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'];
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user