Closed jeremygottfried closed 3 years ago
This seems to be a documentation issue. https://github.com/stalniy/casl#1-define-abilities
The example there doesn't have Ability
as an argument to AbilityBuilder
I will submit a PR to correct it
Thank you!
Yes, starting from v5 AbilityBuilder requires a parameter. Just to make sure people understand which Ability class is going to build.
Describe the bug When using typescript and following the docs, I get two errors:
new AbilityBuilder()
, the error isexpected 1 arguments but got 0
.new Ability(rules)
, the error is To Reproduceexport default function defineAbilitiesFor() { const { can, rules } = new AbilityBuilder();
return new Ability(rules); };