Closed kemalcany closed 6 months ago
I think you use the old version of @casl/mongoose very likely 7.x. This is expected because in that version accessibleBy
returns proxy which is then on property access returns AbilityQuery. this is not the case for 8.x
I double checked and it works as expected -> https://playcode.io/1816910
Close as it’s not casl issue but feel free to comment
Apologies it was my mistake with the editor. Thank you for looking into it!
Hello!
Typescript doesn't allow the mongoose 8.0.1 package usage as described in the latest docs (link and the TS error screenshot below)
https://casl.js.org/v6/en/package/casl-mongoose#accessible-by-helper