diff --git a/dashboard/sharedComponents/input/input.component.ts b/dashboard/sharedComponents/input/input.component.ts index fa414df6..6718bba8 100644 --- a/dashboard/sharedComponents/input/input.component.ts +++ b/dashboard/sharedComponents/input/input.component.ts @@ -48,7 +48,7 @@ export interface Option { - {{formControl.errors.error}} + {{formControl.errors.error}} {{warning}} diff --git a/dashboard/users/role-users/role-users.component.ts b/dashboard/users/role-users/role-users.component.ts index f6a35d97..5007348e 100644 --- a/dashboard/users/role-users/role-users.component.ts +++ b/dashboard/users/role-users/role-users.component.ts @@ -6,6 +6,9 @@ import {UserRegistryService} from "../../../services/user-registry.service"; import {EnvProperties} from "../../../utils/properties/env-properties"; import {properties} from "../../../../../environments/environment"; import {Session} from "../../../login/utils/helper.class"; +import {UserManagementService} from "../../../services/user-management.service"; +import {Router} from "@angular/router"; +import {LoginErrorCodes} from "../../../login/utils/guardHelper.class"; declare var UIkit; @@ -44,11 +47,23 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges { @ViewChild('createRoleModal') createRoleModal: AlertModal; constructor(private userRegistryService: UserRegistryService, + private userManagementService: UserManagementService, + private router: Router, private fb: FormBuilder) { } ngOnInit() { this.updateLists(); + this.userManagementService.getUserInfo().subscribe(user => { + if(!Session.isPortalAdministrator(user) && !Session.isCurator(this.type, user) && !Session.isManager(this.type, this.id, user)) { + this.router.navigate(['/user-info'], { + queryParams: { + "errorCode": LoginErrorCodes.NOT_AUTHORIZED, + "redirectUrl": this.router.url + } + }); + } + }); } ngOnChanges(changes: SimpleChanges) { @@ -129,6 +144,7 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges { this.loadActive = true; this.userRegistryService.remove(this.type, this.id, this.selectedUser, this.role).subscribe(() => { this.active = this.active.filter(user => user.email != this.selectedUser); + this.userManagementService.updateUserInfo(); this.loadActive = false; this.error = null; }, error => { diff --git a/role-verification/role-verification.component.ts b/role-verification/role-verification.component.ts index 13f8c03d..95ca6479 100644 --- a/role-verification/role-verification.component.ts +++ b/role-verification/role-verification.component.ts @@ -17,10 +17,10 @@ import {AlertModal} from "../utils/modal/alert"; Fill in the verification code, sent to your email, to accept the invitation request. -