+
+ onUserChanged () {
+ this.getUserIfNeeded(this.account)
+ }
+
+ onUserDeleted () {
+ this.redirectService.redirectToHomepage()
+ }
+
+ private getUserIfNeeded (account: Account) {
+ if (!account.userId) return
+ if (!this.authService.isLoggedIn()) return
+
+ const user = this.authService.getUser()
+ if (user.hasRight(UserRight.MANAGE_USERS)) {
+ this.userService.getUser(account.userId)
+ .subscribe(
+ user => this.user = user,
+
+ err => this.notificationsService.error(this.i18n('Error'), err.message)
+ )
+ }
+ }