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

enabling hasRole to receive array or string #20

Merged
merged 4 commits into from
Jul 22, 2016

Conversation

brunoneve
Copy link
Contributor

You can check if user has a role.
using hasAnyRole([ 'admin', 'manager'])

You can check if user has a role.
using hasAnyRole method ([ 'admin', 'manager'])
@coveralls
Copy link

Coverage Status

Coverage decreased (-2.1%) to 50.495% when pulling 10d8c19 on brunoneve:master into aa0bbeb on mikemclin:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+2.8%) to 55.446% when pulling f2044f1 on brunoneve:master into aa0bbeb on mikemclin:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+1.9%) to 54.545% when pulling e387771 on brunoneve:master into aa0bbeb on mikemclin:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+1.9%) to 54.545% when pulling e387771 on brunoneve:master into aa0bbeb on mikemclin:master.

@brunoneve
Copy link
Contributor Author

brunoneve commented Jul 22, 2016

using method hasRole('admin') or hasRole([ 'admin', 'manager']);

@mikemclin
Copy link
Owner

Not exactly what I was saying, but I also like the idea of multi-purposing a single method like you implemented. Thanks. Merging.

@mikemclin mikemclin merged commit fff5063 into mikemclin:master Jul 22, 2016
@brunoneve brunoneve changed the title Adding function hasAnyRole enabling hasRole to receive array or string Jul 23, 2016
@mikemclin
Copy link
Owner

Made some tweaks to functionality. Figured we're already using the any verb with canAny and wanted that to carry over to roles. So, I added hasAnyRole. I left the hasRole parameter as either a string or array, but now if an array is given we are checking that every role exists. You can read the docs for further info - https://github.com/mikemclin/angular-acl#aclservicehasrolerole.

Also, this has been tagged, so you should be able to start using this in your project. Thanks again.

@brunoneve
Copy link
Contributor Author

brunoneve commented Jul 24, 2016

Very good. Thx

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

Successfully merging this pull request may close these issues.

None yet

3 participants