Correction autour de l'administrateur

This commit is contained in:
Sébastien André
2021-03-18 16:32:10 +01:00
parent 733e85507a
commit beee601a57
7 changed files with 25 additions and 15 deletions

View File

@@ -26,7 +26,7 @@ export class ListOfAircraftsComponent implements OnInit {
private serviceComm: ServiceComm,
private authenticationService: AuthenticationService,
public dialog: MatDialog) {
this.isUserAdmin = this.authenticationService.currentUserValue.IsAdmin;
this.isUserAdmin = this.authenticationService.currentUserValue.roles === "admin";
}
ngOnInit() {

View File

@@ -32,7 +32,7 @@ export class ListOfDzsComponent implements OnInit {
private serviceComm: ServiceComm,
private authenticationService: AuthenticationService,
public dialog: MatDialog) {
this.isUserAdmin = this.authenticationService.currentUserValue.IsAdmin;
this.isUserAdmin = this.authenticationService.currentUserValue.roles === "admin";
}
ngOnInit() {

View File

@@ -26,7 +26,7 @@ export class ListOfJumpTypesComponent implements OnInit {
private serviceComm: ServiceComm,
private authenticationService: AuthenticationService,
public dialog: MatDialog) {
this.isUserAdmin = this.authenticationService.currentUserValue.IsAdmin;
this.isUserAdmin = this.authenticationService.currentUserValue.roles === "admin";
}
ngOnInit() {

View File

@@ -49,13 +49,11 @@ export class UserProfileComponent implements OnInit {
return;
}
const updatedUser = new User();
updatedUser.login = formData.username;
updatedUser.password = formData.password;
updatedUser.firstName = formData.firstname;
updatedUser.lastName = formData.lastname;
updatedUser.email = formData.email;
// const updatedUser = new User();
// updatedUser.firstName = formData.firstName;
// updatedUser.lastName = formData.lastName;
// updatedUser.email = formData.email;
this.authenticationService.create(updatedUser);
// this.authenticationService.update(updatedUser);
}
}