Skip to content

Commit a4f9aad

Browse files
committed
Declare PolicyModule as dependent on CoreMode
This was not needed before because CoreModule is global. And AuthorizationModule is global, which imports this module. Now it is necessary to help Nest know that Core needs to initialize before this module. Specifically, the PolicyFactory using the GraphQL schema, via the ResourcesHost, to determine interfaces. And the schema needs to be built (on init) before the PolicyFactory.onModuleInit is called.
1 parent e9eaf9e commit a4f9aad

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/components/authorization/policy/policy.module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Module } from '@nestjs/common';
2+
import { CoreModule } from '~/core';
23
import { RoleAndExpUnionOptimizer } from '../policies/conditions/role-and-exp-union.optimizer';
34
import { VariantAndExpUnionOptimizer } from '../policies/conditions/variant-and-exp-union.optimizer';
45
import { FlattenAggregateOptimizer } from './conditions/flatten-aggregate.optimizer';
@@ -11,6 +12,7 @@ import { GrantersFactory } from './granters.factory';
1112
import { PolicyFactory } from './policy.factory';
1213

1314
@Module({
15+
imports: [CoreModule],
1416
providers: [
1517
GrantersFactory,
1618
PolicyFactory,

0 commit comments

Comments
 (0)