Conditions | 1 |
Total Lines | 21 |
Code Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import { DynamicModule, Global, Module } from '@nestjs/common'; |
||
38 | |||
39 | static forDynamic( |
||
40 | rbac: new () => IDynamicStorageRbac, |
||
41 | providers?: any[], |
||
42 | imports?: any[], |
||
43 | ): DynamicModule { |
||
44 | return { |
||
45 | module: RBAcModule, |
||
46 | providers: [ |
||
47 | ...(providers || []), |
||
48 | rbac, |
||
49 | { |
||
50 | provide: StorageRbacService, |
||
51 | useFactory: (moduleRef: ModuleRef, rbacService: IDynamicStorageRbac) => { |
||
52 | return new StorageRbacService(moduleRef, rbacService); |
||
53 | }, |
||
54 | inject: [ModuleRef, rbac], |
||
55 | }, |
||
56 | ], |
||
57 | imports: [ |
||
58 | ...(imports || []), |
||
59 | ], |
||
63 |