Fix sandbox guard stakeholder in data.

This commit is contained in:
Konstantinos Triantafyllou 2024-04-17 12:25:36 +03:00
parent f55d0d3a8f
commit 9bf8001f41
1 changed files with 7 additions and 1 deletions

View File

@ -24,7 +24,13 @@ export class SandboxGuard {
if (childRoute.data['researcher'] && childRoute.params.stakeholder && sandbox) {
return this.checkResearcher(state.url, childRoute.params.stakeholder);
} else {
return !sandbox || this.check(state.url, childRoute.data?.stakeholder?childRoute.data.stakeholder:childRoute.params.stakeholder);
let alias = childRoute.params.stakeholder;
let route = childRoute;
while (!alias && route) {
alias = route.data.stakeholder;
route = route.parent;
}
return !sandbox || this.check(state.url, alias);
}
}