hasAnyRole method has problem
raSooolSh opened this issue · 4 comments
hasAnyRole() method dosent true work when array pass to this and return false always
The test suite shows that it does work with arrays:
laravel-permission/tests/HasRolesTest.php
Lines 675 to 700 in 2cc5362
The problem must be in your code somewhere. Please post your code.
I have the same problem. It only works by passing a string as a parameter
Actually, I always just use hasRole([array])
because hasAnyRole is essentially an alias to hasRole, but without processing guards.
@germanio7 wrote:
I have the same problem. It only works by passing a string as a parameter
What did you pass as an array? Was it just an array of strings? or a collection? or objects?
And how many guards do you have in your application? Did it fail because it checked against a different guard?