entrust icon indicating copy to clipboard operation
entrust copied to clipboard

problem with Ability on EntrustUserTrait

Open raysn0w opened this issue 10 years ago • 1 comments

Am i the only one have problems checking the Ability of an user?

Im using Laravel 5.1.11 and a resource controller with a construct method using this:

$this->middleware('ability:admin,create_quote,true', ['except' => ['index','show']]);

I get an InvalidArgumentException.

I Believe the problem is with this function:

if (!isset($options['validate_all'])) { $options['validate_all'] = false; } else { if ($options['validate_all'] !== true && $options['validate_all'] !== false) { throw new InvalidArgumentException(); }

If i add 'single quotes' to true and false, everything works fine.

raysn0w avatar Oct 22 '15 04:10 raysn0w

Hi I am facing same issue and fix by overriding ability method

Mohammed-Daud avatar May 16 '22 16:05 Mohammed-Daud