mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-14 10:36:54 -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>
|
||||
<nav *ngIf="showNav" class="navbar navbar-default navbar-fixed-top">
|
||||
<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 {
|
||||
return this.user.roles.some(r => r === role);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue