JosephSilber / bouncer

Laravel Eloquent roles and abilities.
MIT License
3.43k stars 330 forks source link

Fix #628 by enabling opt-in to nullable scopes #644

Open grantholle opened 8 months ago

grantholle commented 8 months ago

This tries to rectify the aftermath of #608 by allowing you to opt-in to allowing scope to be null.

To enable pre 1.0.1 functionality, call allowNullScope() when setting the scope.

Bouncer::scope()
    ->to(1)
    ->allowNullScope();
grantholle commented 8 months ago

I don't know if I solved the failing test the right way?