mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-19 21:03:17 -07:00
fix for issue #2152
This commit is contained in:
parent
e8acf79dc8
commit
680c0abd05
2 changed files with 10 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
||||||
<div class="{{ user.name && (hasRole('Admin') || hasRole('PowerUser')) ? 'adminUser' : 'user'}}">
|
<div [ngClass]="user.name && roleClass()">
|
||||||
<p-growl [value]="notificationService.messages" [life]="3000"></p-growl>
|
<p-growl [value]="notificationService.messages" [life]="3000"></p-growl>
|
||||||
<nav *ngIf="showNav" class="navbar navbar-default navbar-fixed-top">
|
<nav *ngIf="showNav" class="navbar navbar-default navbar-fixed-top">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
|
|
|
@ -73,6 +73,15 @@ export class AppComponent implements OnInit {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public roleClass() {
|
||||||
|
if (this.user.roles.some(r => r === 'Admin')) {
|
||||||
|
return "adminUser";
|
||||||
|
} else if (this.user.roles.some(r => r === 'PowerUser')) {
|
||||||
|
return "powerUser";
|
||||||
|
}
|
||||||
|
return "user";
|
||||||
|
}
|
||||||
|
|
||||||
public hasRole(role: string): boolean {
|
public hasRole(role: string): boolean {
|
||||||
return this.user.roles.some(r => r === role);
|
return this.user.roles.some(r => r === role);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue