src/app/core/navigation/administration/administration.component.ts
selector | cd-administration |
styleUrls | ./administration.component.scss |
templateUrl | ./administration.component.html |
Properties |
Methods |
constructor(authStorageService: AuthStorageService)
|
||||||
Parameters :
|
ngOnInit |
ngOnInit()
|
Returns :
void
|
userPermission |
Type : Permission
|
import { Component, OnInit } from '@angular/core';
import { Permission } from '../../../shared/models/permissions';
import { AuthStorageService } from '../../../shared/services/auth-storage.service';
@Component({
selector: 'cd-administration',
templateUrl: './administration.component.html',
styleUrls: ['./administration.component.scss']
})
export class AdministrationComponent implements OnInit {
userPermission: Permission;
constructor(private authStorageService: AuthStorageService) {
this.userPermission = this.authStorageService.getPermissions().user;
}
ngOnInit() {}
}
<div dropdown
*ngIf="userPermission.read">
<a dropdownToggle
class="dropdown-toggle"
data-toggle="dropdown"
i18n-title
title="Dashboard Settings">
<i class="fa fa-fw fa-cog"></i>
<span i18n
class="visible-xs-inline-block">Dashboard Settings</span>
<span class="caret"></span>
</a>
<ul *dropdownMenu
class="dropdown-menu dropdown-menu-right">
<li *ngIf="userPermission.read">
<a i18n
class="dropdown-item"
routerLink="/user-management">User management</a>
</li>
</ul>
</div>
./administration.component.scss