Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
pdorgambide opened this issue Apr 10, 2017 · 1 comment
Open

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

pdorgambide opened this issue Apr 10, 2017 · 1 comment

Comments

@pdorgambide
Copy link

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
Copy link

ghost commented Apr 10, 2017

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

pdorgambide added a commit to pdorgambide/ng-security that referenced this issue Apr 18, 2017
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,]+/);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant