auth0 / laravel-auth0

Laravel SDK for Auth0 Authentication and Management APIs.
MIT License
246 stars 135 forks source link

Feature request: can disable ability check (RBAC) #457

Open margarizaldi opened 3 months ago

margarizaldi commented 3 months ago

Checklist

Description

The way this package checks the ability in Gate prevents me to use permissions (using spatie/permission) that contain : character. Although I can rename all my permissions, I think that shouldn't be the solution...

// ServiceProviderAbstract

$gate->before(static function (?Authenticatable $user, ?string $ability) {
    $guard = auth()->guard();

    // ⭐ maybe add one more condition (e.g.) ! config('auth0.enable_rbac')
    if (! $guard instanceof GuardContract || ! $user instanceof Authenticatable || ! is_string($ability)) {
        return;
    }

    // ...
});