victorybiz / vue-simple-acl

A simple unopinionated Vue plugin for managing user roles and permissions, access-control list (ACL) and role-based access control (RBAC).
https://github.com/victorybiz/vue-simple-acl
131 stars 24 forks source link

Permissions as an array of abilities doesn't work properly #12

Closed ionutvladu closed 2 years ago

ionutvladu commented 2 years ago

There is a bug in VueSimpleAcl.ts at line 137 https://github.com/victorybiz/vue-simple-acl/blob/a566763274f40dccac89f8832db092bb188e1239/src/VueSimpleAcl.ts#L137

The if condition is not good

callbackResponse =  evaluateAbilityCallback(callback, ability.abilities, ability.args);
        if (validCount) {
          validCount++;
        }

the fix is

       callbackResponse =  evaluateAbilityCallback(callback, ability.abilities, ability.args);
        if (callbackResponse ) {
          validCount++;
        }
victorybiz commented 2 years ago

Thank you @ionutvladu , issue fixed in v2.0.2