From 1ebb1b39d6e4a604e818ba9ec529d4c3a932848a Mon Sep 17 00:00:00 2001 From: xkureck Date: Tue, 17 Aug 2021 12:38:51 +0200 Subject: [PATCH] fix(admin-gui): fix of auth rights on application detail * on application detail group manager couldnt approve application * this was cause by the wrong parent params which failed the authorization --- .../application-detail.component.ts | 51 ++++++++++--------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/apps/admin-gui/src/app/vos/components/application-detail/application-detail.component.ts b/apps/admin-gui/src/app/vos/components/application-detail/application-detail.component.ts index 71c80bb08..4d0a3c245 100644 --- a/apps/admin-gui/src/app/vos/components/application-detail/application-detail.component.ts +++ b/apps/admin-gui/src/app/vos/components/application-detail/application-detail.component.ts @@ -52,33 +52,34 @@ export class ApplicationDetailComponent implements OnInit { ngOnInit() { this.loading = true; - this.route.params.subscribe(parentParams => { - - if (parentParams['groupId']) { - this.dialogTheme = 'group-theme'; - } else if (parentParams['memberId']) { - this.dialogTheme = 'member-theme'; - } else { - this.dialogTheme = 'vo-theme'; - } - const applicationId = parentParams['applicationId']; - this.registrarManager.getApplicationById(applicationId).subscribe(application => { - this.application = application; - if (this.application.type === 'EMBEDDED' && this.application.user){ - this.usersService.getRichUserWithAttributes(this.application.user.id).subscribe(user => { - const preferredMail = user.userAttributes.find(att => att.friendlyName === 'preferredMail'); - this.userMail = preferredMail?.value?.toString(); - this.setAuthRights(); - this.loading = false; - }); + this.route.params.subscribe(params => { + this.route.parent.params.subscribe(parentParams =>{ + if (parentParams['groupId']) { + this.dialogTheme = 'group-theme'; + } else if (parentParams['memberId']) { + this.dialogTheme = 'member-theme'; } else { - this.registrarManager.getApplicationDataById(this.application.id).subscribe(value => { - this.userData = value; - this.dataSource = new MatTableDataSource(this.userData); - this.setAuthRights(); - this.loading = false; - }); + this.dialogTheme = 'vo-theme'; } + const applicationId = params['applicationId']; + this.registrarManager.getApplicationById(applicationId).subscribe(application => { + this.application = application; + if (this.application.type === 'EMBEDDED' && this.application.user){ + this.usersService.getRichUserWithAttributes(this.application.user.id).subscribe(user => { + const preferredMail = user.userAttributes.find(att => att.friendlyName === 'preferredMail'); + this.userMail = preferredMail?.value?.toString(); + this.setAuthRights(); + this.loading = false; + }); + } else { + this.registrarManager.getApplicationDataById(this.application.id).subscribe(value => { + this.userData = value; + this.dataSource = new MatTableDataSource(this.userData); + this.setAuthRights(); + this.loading = false; + }); + } + }); }); }); }