nestjs-rbac icon indicating copy to clipboard operation
nestjs-rbac copied to clipboard

Can not import RBAcModule on AppModule

Open quangnv205 opened this issue 4 years ago • 3 comments

Can not import RBAcModule on AppModule RBAcModule.forDynamic(DynamicStorageService) Argument of type 'typeof DynamicStorageService' is not assignable to parameter of type 'new () => IDynamicStorageRbac'. Types of construct signatures are incompatible. Type 'new (repository: any) => DynamicStorageService' is not assignable to type 'new () => IDynamicStorageRbac'.ts

Capture

quangnv205 avatar Feb 01 '21 07:02 quangnv205

Hi, I guess something wrong with your implementation of interface

sergey-telpuk avatar Feb 01 '21 12:02 sergey-telpuk

the DynamicStorageService's constructor should not have any parameters?

MichaelHu18 avatar Dec 24 '21 07:12 MichaelHu18

the DynamicStorageService's constructor should not have any parameters?

Hi, it works like an inject service, parameters depend on nestjs implementation(di,IoC). But agree with you, we need to support parameters in constructor. If you have some improvement ideas or PR I will be pleased to consider it. Thanks for using Rbac!

sergey-telpuk avatar Dec 25 '21 07:12 sergey-telpuk