Super Admin Gate Not Working On Middleware Route #2487
-
I don't know if this is an intended behavior or not, but it seems to not match up to what I expected. I expected that defining a "Super Admin Gate" would override everything. It doesn't seem to be the case. I defined a "root" gate in public function boot(): void
{
// not sure if this is needed?
//$this->registerPolicies();
Gate::before(function ($user, $ability) {
return $user->hasRole('root') ? true : null;
});
} Notice I have So, I now should have a global However, that doesn't seem to be the case. At least with route middlewares. In Route::middleware([
'role:super_admin|admin'
])->group(function () {
Route::get('/test', [TestController::class, 'test']);
}); So now, I expect that my user with the Obviously, if I add root to the middleware list, ie: Is this the intended behavior? Is the AuthServiceProvider Gate check only for checking against permissions like |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Yes, it is, i try to fix that on 9384223, but that change was not accepted Try
|
Beta Was this translation helpful? Give feedback.
-
This Issue was fixed months ago. Yet it's not included in your latest release which was released last week. |
Beta Was this translation helpful? Give feedback.
Yes, it is, i try to fix that on 9384223, but that change was not accepted
Try
role_or_permission
middleware insteadba5a7be