mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-01-06 12:58:45 +00:00
Handle normal user cannot access user management page. Fixes https://github.com/GNS3/gns3-server/issues/2460
Some checks are pending
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
Build / Node ${{ matrix.node }} (14) (push) Waiting to run
Build / Node ${{ matrix.node }} (16) (push) Waiting to run
Build / Node ${{ matrix.node }} (18) (push) Waiting to run
Some checks are pending
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
Build / Node ${{ matrix.node }} (14) (push) Waiting to run
Build / Node ${{ matrix.node }} (16) (push) Waiting to run
Build / Node ${{ matrix.node }} (18) (push) Waiting to run
This commit is contained in:
parent
2e581c4495
commit
2227d11932
@ -11,6 +11,7 @@
|
|||||||
* Author: Sylvain MATHIEU, Elise LEBEAU
|
* Author: Sylvain MATHIEU, Elise LEBEAU
|
||||||
*/
|
*/
|
||||||
import {Component, OnInit, QueryList, ViewChild, ViewChildren} from '@angular/core';
|
import {Component, OnInit, QueryList, ViewChild, ViewChildren} from '@angular/core';
|
||||||
|
import {Location} from '@angular/common';
|
||||||
import {ActivatedRoute, Router} from "@angular/router";
|
import {ActivatedRoute, Router} from "@angular/router";
|
||||||
import {Controller} from "@models/controller";
|
import {Controller} from "@models/controller";
|
||||||
import {MatSort} from "@angular/material/sort";
|
import {MatSort} from "@angular/material/sort";
|
||||||
@ -49,7 +50,8 @@ export class UserManagementComponent implements OnInit {
|
|||||||
private progressService: ProgressService,
|
private progressService: ProgressService,
|
||||||
private controllerService: ControllerService,
|
private controllerService: ControllerService,
|
||||||
public dialog: MatDialog,
|
public dialog: MatDialog,
|
||||||
private toasterService: ToasterService) { }
|
private toasterService: ToasterService,
|
||||||
|
private location: Location) { }
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
const controllerId = this.route.parent.snapshot.paramMap.get('controller_id');
|
const controllerId = this.route.parent.snapshot.paramMap.get('controller_id');
|
||||||
@ -88,6 +90,8 @@ export class UserManagementComponent implements OnInit {
|
|||||||
},
|
},
|
||||||
(error) => {
|
(error) => {
|
||||||
this.progressService.setError(error);
|
this.progressService.setError(error);
|
||||||
|
this.toasterService.error(`Cannot open the user management page`);
|
||||||
|
this.location.back();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user