JosephSilber / bouncer

Laravel Eloquent roles and abilities.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can helper returning true after removing role from the user

justasSendrauskas opened this issue · comments

commented

using Bouncer v1.0.1
In unit tests i have:

allow('some-admin')->to('manage', Some::class);
Bouncer::dontCache();

$user->assign('some-admin');
Bouncer::refresh();

$user->isA('some-admin'); // returns true
$user->can('manage', Some::class); // returns true

$user->retract('some-admin');
Bouncer::refresh();

$user->isA('some-admin'); // returns false
$user->can('manage', Some::class); // returns true where it should be false

not using any scopes

That doesn't sound right. Testing it myself, I can't reproduce it. Could you maybe make a small repository demonstrating this issue?

commented

thank you for getting back so promptly, did not expect that.

It leads me thinking it might be some configuration, will investigate/create repo, and report back