RED-2877: Account screen permissions
This commit is contained in:
parent
fb63499183
commit
9bbf7d211e
@ -34,7 +34,7 @@ export class BaseScreenComponent {
|
||||
{
|
||||
name: _('top-bar.navigation-items.my-account.children.account'),
|
||||
routerLink: '/main/account',
|
||||
show: this.currentUser.isUser,
|
||||
show: true,
|
||||
action: this.appStateService.reset,
|
||||
showDot: () => false,
|
||||
},
|
||||
|
||||
@ -14,7 +14,6 @@ const routes = [
|
||||
canActivate: [CompositeRouteGuard],
|
||||
data: {
|
||||
routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard],
|
||||
requiredRoles: ['RED_USER'],
|
||||
},
|
||||
loadChildren: () => import('./screens/user-profile/user-profile.module').then(m => m.UserProfileModule),
|
||||
},
|
||||
@ -24,6 +23,7 @@ const routes = [
|
||||
canActivate: [CompositeRouteGuard],
|
||||
data: {
|
||||
routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard],
|
||||
requiredRoles: ['RED_USER'],
|
||||
},
|
||||
loadChildren: () => import('./screens/notifications/notifications.module').then(m => m.NotificationsModule),
|
||||
},
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<iqser-side-nav [title]="'account-settings' | translate">
|
||||
<ng-container *ngFor="let item of items">
|
||||
<div [routerLinkActiveOptions]="{ exact: false }" [routerLink]="'../' + item.screen" class="item" routerLinkActive="active">
|
||||
<div *ngIf="!item.hideIf"
|
||||
[routerLinkActiveOptions]="{ exact: false }" [routerLink]="'../' + item.screen" class="item" routerLinkActive="active">
|
||||
{{ item.label | translate }}
|
||||
</div>
|
||||
</ng-container>
|
||||
|
||||
@ -1,9 +1,11 @@
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
||||
import { UserService } from '@services/user.service';
|
||||
|
||||
interface NavItem {
|
||||
readonly label: string;
|
||||
readonly screen: string;
|
||||
readonly hideIf?: boolean;
|
||||
}
|
||||
|
||||
@Component({
|
||||
@ -21,6 +23,9 @@ export class AccountSideNavComponent {
|
||||
{
|
||||
screen: 'notifications',
|
||||
label: _('notifications'),
|
||||
hideIf: !this._userService.currentUser.isUser,
|
||||
},
|
||||
];
|
||||
|
||||
constructor(private readonly _userService: UserService) {}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user