Closed viveksudalai closed 3 years ago
Would you please help me to resolve this?
Hi!
Sounds like our default model is not compatible with spatie/laravel-permission
.
Said that, I'm not sure you should use spatie/laravel-permission
as it is used to manage roles and permissions: Keycloak is already able to do that.
Anyway, here is how to implement User as a Eloquent Model:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hi, I am using Laravel and Vue.Js. Login and redirection is working fine. But i am getting following error when i try to use "abort_if(Gate::denies('keycloak-web','Client Admin'), Response::HTTP_FORBIDDEN, '403 Forbidden') " in my controller. 'Client Admin' is the Keycloak client Role.
message | "Argument 1 passed to Spatie\Permission\PermissionRegistrar::Spatie\Permission\{closure}() must be an instance of Illuminate\Contracts\Auth\Access\Authorizable, instance of Vizir\KeycloakWebGuard\Models\KeycloakUser given, called in /opt/lampp/htdocs/XXXweb/vendor/laravel/framework/src/Illuminate/Auth/Access/Gate.php on line 495"
exception | "TypeError" file | "/opt/lampp/htdocs/XXXweb/vendor/spatie/laravel-permission/src/PermissionRegistrar.php"
And also i have role and their permission in my application. I want to use my application permission instead of keycloak resoureces.
auth.php
guards' => [ 'web' => [ 'driver' => 'keycloak-web', 'provider' => 'keycloak-users', ],
'providers' => [ 'users' => [ 'driver' => 'eloquent', 'model' => App\Models\User::class, ], 'keycloak-users' => [ 'driver' => 'keycloak-users', 'model' => Vizir\KeycloakWebGuard\Models\KeycloakUser::class, ], ],