I was trying to setup a class based Subject Hook on a rule without conditions but wasn't able to get it working.
The bundled test case uses the following permission spec:
can(Actions.update, Post, { userId: user.id });
if the test case is setup us as the following spec instead, the PostHook wouldn't fire:
can(Actions.update, Post);
Please review the line access.service.ts #99
|
if (!relevantRules.every((rule) => rule.conditions) || !ability.subjectHook) { |
Should it having an AND (&&) condition instead of an OR (||) ? This condition doesn't allow rules without conditions to specify a SubjectHook.
Thanks!