concretesolutions / ng-security

A security module for AngularJS.
MIT License
31 stars 4 forks source link

Trim permission tokens (ng-if-permission) #11

Open pdorgambide opened 7 years ago

pdorgambide commented 7 years ago

A comma separated string could be writted with white spaces, at least in my case: ng-if-permission="ROLE_ADMINISTRADOR, ROLE_SUPERVISOR"

It is solved and made the code more robust using trim and split as: permissions = attrs.ngIfPermission.split(/[\s,]+/);

It would be applied to all cases.

ghost commented 7 years ago

Oh Great! Can you please create a pull request with this refactoring? Thank you :)