fixed um visibillity

master
FlayInAHook 4 years ago
parent 009ce02301
commit d143bab32d

@ -89,7 +89,7 @@
<!--<app-admin-data-page *ngIf="this.authService.getCurrentUserValue.user.roles.includes('admin')"></app-admin-data-page>
-->
<div id="usermanagement">
<div id="usermanagement" *ngIf="!authService.getCurrentUserValue.user.rolesString.includes('SUPERADMIN')">
<app-admin-data-page></app-admin-data-page>
</div>

@ -60,6 +60,7 @@ export class ProfileComponent implements OnInit {
user.own_password = this.password.value;
user.password = this.passwordNew.value;
this.loading = true;
this.userService.updateUser(user).subscribe(
data => {

@ -4,6 +4,7 @@ import { catchError, finalize, map, tap } from 'rxjs/operators';
import { environment } from '../../environments/environment';
import { Observable, BehaviorSubject, of } from 'rxjs';
import { AuthUser } from "../models/user";
import { JsonPipe } from '@angular/common';
@Injectable({
@ -32,6 +33,14 @@ export class AuthService {
if (value === null){
value = new AuthUser();
}
if (value.user != undefined){
let roles = [];
for (let role of value.user.roles){
roles.push(role.name);
}
value.user.rolesString = roles.join(', ');
console.log("Getting user" + JSON.stringify(value));
}
return value;
}

Loading…
Cancel
Save