|
|
@ -28,6 +28,7 @@ export class AppComponent implements OnInit {
|
|
|
|
public voteEnabled = false;
|
|
|
|
public voteEnabled = false;
|
|
|
|
public applicationName: string = "Ombi"
|
|
|
|
public applicationName: string = "Ombi"
|
|
|
|
public isAdmin: boolean;
|
|
|
|
public isAdmin: boolean;
|
|
|
|
|
|
|
|
public username: string;
|
|
|
|
|
|
|
|
|
|
|
|
private checkedForUpdate: boolean;
|
|
|
|
private checkedForUpdate: boolean;
|
|
|
|
|
|
|
|
|
|
|
@ -86,6 +87,9 @@ export class AppComponent implements OnInit {
|
|
|
|
this.currentUrl = event.url;
|
|
|
|
this.currentUrl = event.url;
|
|
|
|
if (event instanceof NavigationStart) {
|
|
|
|
if (event instanceof NavigationStart) {
|
|
|
|
this.user = this.authService.claims();
|
|
|
|
this.user = this.authService.claims();
|
|
|
|
|
|
|
|
if(this.user && this.user.username) {
|
|
|
|
|
|
|
|
this.username = this.user.username;
|
|
|
|
|
|
|
|
}
|
|
|
|
this.isAdmin = this.authService.hasRole("admin");
|
|
|
|
this.isAdmin = this.authService.hasRole("admin");
|
|
|
|
this.showNav = this.authService.loggedIn();
|
|
|
|
this.showNav = this.authService.loggedIn();
|
|
|
|
|
|
|
|
|
|
|
@ -101,17 +105,6 @@ export class AppComponent implements OnInit {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public roleClass() {
|
|
|
|
|
|
|
|
if (this.user) {
|
|
|
|
|
|
|
|
if (this.user.roles.some(r => r === "Admin")) {
|
|
|
|
|
|
|
|
return "adminUser";
|
|
|
|
|
|
|
|
} else if (this.user.roles.some(r => r === "PowerUser")) {
|
|
|
|
|
|
|
|
return "powerUser";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return "user";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public openMobileApp(event: any) {
|
|
|
|
public openMobileApp(event: any) {
|
|
|
|
event.preventDefault();
|
|
|
|
event.preventDefault();
|
|
|
|
if (!this.customizationSettings.applicationUrl) {
|
|
|
|
if (!this.customizationSettings.applicationUrl) {
|
|
|
|