Skip to content

Commit

Permalink
fix(admin-gui): fix of auth rights on application detail
Browse files Browse the repository at this point in the history
* on application detail group manager couldnt approve application
* this was cause by the wrong parent params which failed the authorization
  • Loading branch information
xkureck authored and Vojtech-Sassmann committed Sep 6, 2021
1 parent 6097367 commit 1ebb1b3
Showing 1 changed file with 26 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<ApplicationFormItemData>(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<ApplicationFormItemData>(this.userData);
this.setAuthRights();
this.loading = false;
});
}
});
});
});
}
Expand Down

0 comments on commit 1ebb1b3

Please sign in to comment.