fix(console): restore url after state handling, remove user metadata without user.write permission (#4136)

* metadata role check

* fix: restore url after handling state

* hide metadata if has user not user.write

* allow metadata read

Co-authored-by: Livio Spring <livio.a@gmail.com>
This commit is contained in:
Max Peintner 2022-08-08 15:03:28 +02:00 committed by GitHub
parent d4d39dbd80
commit 075fd1dfe6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 3 deletions

View File

@ -1,7 +1,15 @@
<cnsl-card class="metadata-details" title="{{ 'USER.METADATA.TITLE' | translate }}">
<div class="metadata-actions">
<mat-spinner class="spinner" diameter="20" *ngIf="loading"></mat-spinner>
<button mat-raised-button color="primary" class="edit" (click)="editMetadata()">{{ 'ACTIONS.EDIT' | translate }}</button>
<button
[disabled]="(['user.write:' + userId, 'user.write'] | hasRole | async) === false"
mat-raised-button
color="primary"
class="edit"
(click)="editMetadata()"
>
{{ 'ACTIONS.EDIT' | translate }}
</button>
</div>
<ng-container *ngIf="metadata?.length; else emptyList">

View File

@ -28,8 +28,7 @@ export class StatehandlerProcessorServiceImpl implements StatehandlerProcessorSe
return;
} else {
sessionStorage.removeItem(state);
// window.location.replace(window.location.origin + url);
this.router.navigate([url]);
this.router.navigateByUrl(url);
}
}
}