permissions resolver fix
This commit is contained in:
parent
b81903a735
commit
27b6643180
|
@ -46,14 +46,6 @@ export class DescriptionEditorEntityResolver extends BaseEditorResolver {
|
|||
]
|
||||
}
|
||||
|
||||
public static permissionLookupFields(): string[] {
|
||||
return [
|
||||
nameof<Description>(x => x.id),
|
||||
[nameof<Description>(x => x.plan), nameof<Plan>(x => x.id)].join('.'),
|
||||
[nameof<Description>(x => x.planDescriptionTemplate), nameof<PlanDescriptionTemplate>(x => x.sectionId)].join('.'),
|
||||
]
|
||||
}
|
||||
|
||||
public static descriptionLookupFields(): string[] {
|
||||
return [
|
||||
...BaseEditorResolver.lookupFields(),
|
||||
|
|
|
@ -1,16 +1,14 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import { ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
|
||||
import { DescriptionStatus } from '@app/core/common/enum/description-status';
|
||||
import { Description, DescriptionSectionPermissionResolver } from '@app/core/model/description/description';
|
||||
import { DescriptionService } from '@app/core/services/description/description.service';
|
||||
import { PlanService } from '@app/core/services/plan/plan.service';
|
||||
import { BreadcrumbService } from '@app/ui/misc/breadcrumb/breadcrumb.service';
|
||||
import { BaseEditorResolver } from '@common/base/base-editor.resolver';
|
||||
import { Guid } from '@common/types/guid';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { concatMap, map, mergeMap, takeUntil, tap } from 'rxjs/operators';
|
||||
import { DescriptionEditorEntityResolver } from './description-editor-entity.resolver';
|
||||
import { mergeMap, takeUntil, tap } from 'rxjs/operators';
|
||||
import { AppPermission } from '@app/core/common/enum/permission.enum';
|
||||
import { nameof } from 'ts-simple-nameof';
|
||||
import { Plan, PlanDescriptionTemplate } from '@app/core/model/plan/plan';
|
||||
|
||||
@Injectable()
|
||||
export class DescriptionEditorPermissionsResolver extends BaseEditorResolver {
|
||||
|
@ -18,16 +16,22 @@ export class DescriptionEditorPermissionsResolver extends BaseEditorResolver {
|
|||
constructor(
|
||||
private descriptionService: DescriptionService,
|
||||
private breadcrumbService: BreadcrumbService,
|
||||
private language: TranslateService,
|
||||
private planService: PlanService
|
||||
) {
|
||||
super();
|
||||
}
|
||||
|
||||
public static permissionLookupFields(): string[] {
|
||||
return [
|
||||
nameof<Description>(x => x.id),
|
||||
[nameof<Description>(x => x.plan), nameof<Plan>(x => x.id)].join('.'),
|
||||
[nameof<Description>(x => x.planDescriptionTemplate), nameof<PlanDescriptionTemplate>(x => x.sectionId)].join('.'),
|
||||
]
|
||||
}
|
||||
|
||||
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
|
||||
|
||||
const fields = [
|
||||
...DescriptionEditorEntityResolver.permissionLookupFields()
|
||||
...DescriptionEditorPermissionsResolver.permissionLookupFields()
|
||||
];
|
||||
const id = route.paramMap.get('id');
|
||||
const planId = route.paramMap.get('planId');
|
||||
|
|
|
@ -8,7 +8,9 @@ import { BreadcrumbService } from '@app/ui/misc/breadcrumb/breadcrumb.service';
|
|||
import { BaseEditorResolver } from '@common/base/base-editor.resolver';
|
||||
import { Guid } from '@common/types/guid';
|
||||
import { mergeMap, takeUntil, tap } from 'rxjs/operators';
|
||||
import { PlanEditorEntityResolver } from './plan-editor-enitity.resolver';
|
||||
import { Plan } from '@app/core/model/plan/plan';
|
||||
import { nameof } from 'ts-simple-nameof';
|
||||
import { PlanBlueprint, PlanBlueprintDefinition, PlanBlueprintDefinitionSection } from '@app/core/model/plan-blueprint/plan-blueprint';
|
||||
|
||||
@Injectable()
|
||||
export class PlanEditorPermissionsResolver extends BaseEditorResolver {
|
||||
|
@ -20,10 +22,17 @@ export class PlanEditorPermissionsResolver extends BaseEditorResolver {
|
|||
super();
|
||||
}
|
||||
|
||||
public static permissionLookupFields(): string[] {
|
||||
return [
|
||||
nameof<Plan>(x => x.id),
|
||||
[nameof<Plan>(x => x.blueprint), nameof<PlanBlueprint>(x => x.definition), nameof<PlanBlueprintDefinition>(x => x.sections), nameof<PlanBlueprintDefinitionSection>(x => x.id)].join('.'),
|
||||
]
|
||||
}
|
||||
|
||||
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
|
||||
|
||||
const fields = [
|
||||
...PlanEditorEntityResolver.lookupFields()
|
||||
...PlanEditorPermissionsResolver.permissionLookupFields()
|
||||
];
|
||||
const id = route.paramMap.get('id');
|
||||
if (id != null) {
|
||||
|
|
Loading…
Reference in New Issue