fix: permission on nav (#3656)

Co-authored-by: Livio Amstutz <[email protected]>
This commit is contained in:
Max Peintner
2022-05-18 12:16:11 +00:00
committed by GitHub
co-authored by Livio Amstutz
parent 5901991dd3
commit 17baf252dd
9 changed files with 42 additions and 25 deletions
@@ -248,6 +248,12 @@
<tr class="highlight" mat-row *matRowDef="let row; columns: displayedColumns"></tr>
</table>
</div>
<div *ngIf="(loading$ | async) === false && !dataSource?.data?.length" class="no-content-row">
<i class="las la-exclamation"></i>
<span>{{ 'IDP.EMPTY' | translate }}</span>
</div>
<cnsl-paginator
#paginator
class="paginator"
@@ -49,9 +49,11 @@
</ng-container>
</div>
<button mat-button class="show-all" [routerLink]="['/orgs']" (click)="closedCard.emit()">
{{ 'MENU.SHOWORGS' | translate }}
</button>
<ng-template cnslHasRole [hasRole]="['iam.read']">
<button mat-button class="show-all" [routerLink]="['/orgs']" (click)="closedCard.emit()">
{{ 'MENU.SHOWORGS' | translate }}
</button>
</ng-template>
<ng-template cnslHasRole [hasRole]="['org.create', 'iam.write']">
<button mat-button [routerLink]="['/org/create']" (click)="closedCard.emit()">
@@ -4,7 +4,26 @@
<mat-spinner diameter="30" *ngIf="loading" color="primary"></mat-spinner>
</div>
<h2>{{ 'MFA.LIST.MULTIFACTORTITLE' | translate }}</h2>
<h2>{{ 'SETTINGS.LIST.LOGIN' | translate }}</h2>
<ng-container *ngIf="serviceType === PolicyComponentServiceType.MGMT && !isDefault">
<ng-template cnslHasRole [hasRole]="['policy.delete']">
<button
color="primary"
class="loginpolicy-reset-button"
matTooltip="{{ 'POLICY.RESET' | translate }}"
color="warn"
(click)="removePolicy()"
mat-stroked-button
>
{{ 'POLICY.RESET' | translate }}
</button>
</ng-template>
</ng-container>
<br />
<h3>{{ 'MFA.LIST.MULTIFACTORTITLE' | translate }}</h3>
<p class="cnsl-secondary-text">{{ 'MFA.LIST.MULTIFACTORDESCRIPTION' | translate }}</p>
<div class="login-policy-row" *ngIf="loginData">
@@ -41,7 +60,7 @@
<br />
<h2>{{ 'MFA.LIST.SECONDFACTORTITLE' | translate }}</h2>
<h3>{{ 'MFA.LIST.SECONDFACTORTITLE' | translate }}</h3>
<p class="cnsl-secondary-text">{{ 'MFA.LIST.SECONDFACTORDESCRIPTION' | translate }}</p>
<div *ngIf="loginData" class="login-policy-row">
@@ -71,7 +90,7 @@
<br />
<h2>{{ 'POLICY.LOGIN_POLICY.LIFETIMEDURATIONS' | translate }}</h2>
<h3>{{ 'POLICY.LOGIN_POLICY.LIFETIMEDURATIONS' | translate }}</h3>
<form class="lifetime-form" (ngSubmit)="savePolicy()" [formGroup]="lifetimeForm" autocomplete="off">
<cnsl-form-field class="lifetime-form-field" label="Password Check Lifetime" required="true">
@@ -120,7 +139,7 @@
<br />
<h2>{{ 'POLICY.LOGIN_POLICY.ADVANCED' | translate }}</h2>
<h3>{{ 'POLICY.LOGIN_POLICY.ADVANCED' | translate }}</h3>
<div class="max-card-width login-policy-content" *ngIf="loginData">
<div class="login-policy-row">
@@ -192,21 +211,6 @@
</div>
</div>
<ng-container *ngIf="serviceType === PolicyComponentServiceType.MGMT && !isDefault">
<ng-template cnslHasRole [hasRole]="['policy.delete']">
<button
color="primary"
class="loginpolicy-reset-button"
matTooltip="{{ 'POLICY.RESET' | translate }}"
color="warn"
(click)="removePolicy()"
mat-stroked-button
>
{{ 'POLICY.RESET' | translate }}
</button>
</ng-template>
</ng-container>
<br />
<div class="login-policy-btn-container">