|
|
@@ -1,6 +1,8 @@
|
|
|
import { Component } from '@angular/core';
|
|
|
import { AuthService } from '@auth0/auth0-angular';
|
|
|
import { MenuItem } from 'primeng/api';
|
|
|
+import { ConfigService } from 'src/app/config.service';
|
|
|
+import { PermissionService } from 'src/app/users/permission.service';
|
|
|
|
|
|
@Component({
|
|
|
selector: 'app-main-menu',
|
|
|
@@ -12,6 +14,8 @@ export class MainMenuComponent {
|
|
|
|
|
|
constructor(
|
|
|
private readonly authService: AuthService,
|
|
|
+ private readonly permissionService: PermissionService,
|
|
|
+ private readonly configService: ConfigService
|
|
|
) {
|
|
|
this.menuItems = [
|
|
|
{
|
|
|
@@ -43,12 +47,24 @@ export class MainMenuComponent {
|
|
|
routerLink: ['/events/edit/new']
|
|
|
}
|
|
|
],
|
|
|
- },
|
|
|
- {
|
|
|
- label: 'Logout',
|
|
|
- command: () => this.logout()
|
|
|
}
|
|
|
];
|
|
|
+
|
|
|
+ this.permissionService.userProfile.then(profile => {
|
|
|
+ this.menuItems = this.menuItems.concat([{
|
|
|
+ label: 'My Profile',
|
|
|
+ items: [
|
|
|
+ {
|
|
|
+ label: 'Details',
|
|
|
+ routerLink: ['/profile']
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: 'Logout',
|
|
|
+ command: () => this.logout()
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }]);
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
public logout(): void {
|