From 2227d1193289f65be04a016526557b81e81fb21d Mon Sep 17 00:00:00 2001 From: grossmj Date: Thu, 26 Dec 2024 17:21:37 +0700 Subject: [PATCH] Handle normal user cannot access user management page. Fixes https://github.com/GNS3/gns3-server/issues/2460 --- .../components/user-management/user-management.component.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/components/user-management/user-management.component.ts b/src/app/components/user-management/user-management.component.ts index 19d47277..e2c50fc1 100644 --- a/src/app/components/user-management/user-management.component.ts +++ b/src/app/components/user-management/user-management.component.ts @@ -11,6 +11,7 @@ * Author: Sylvain MATHIEU, Elise LEBEAU */ import {Component, OnInit, QueryList, ViewChild, ViewChildren} from '@angular/core'; +import {Location} from '@angular/common'; import {ActivatedRoute, Router} from "@angular/router"; import {Controller} from "@models/controller"; import {MatSort} from "@angular/material/sort"; @@ -49,7 +50,8 @@ export class UserManagementComponent implements OnInit { private progressService: ProgressService, private controllerService: ControllerService, public dialog: MatDialog, - private toasterService: ToasterService) { } + private toasterService: ToasterService, + private location: Location) { } ngOnInit() { const controllerId = this.route.parent.snapshot.paramMap.get('controller_id'); @@ -88,6 +90,8 @@ export class UserManagementComponent implements OnInit { }, (error) => { this.progressService.setError(error); + this.toasterService.error(`Cannot open the user management page`); + this.location.back(); } ); }