diff --git a/src/app/shared/sandbox.guard.ts b/src/app/shared/sandbox.guard.ts index 77dd1cc..ce740fd 100644 --- a/src/app/shared/sandbox.guard.ts +++ b/src/app/shared/sandbox.guard.ts @@ -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); } }