fix: resolve super_admin login, echo crash and GD extension test failures
This commit is contained in:
@@ -17,6 +17,10 @@ class EnsureUserHasRole
|
||||
return ApiResponse::error('Unauthenticated', null, Response::HTTP_UNAUTHORIZED);
|
||||
}
|
||||
|
||||
if ($user->role === 'super_admin') {
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
if (! in_array($user->role, $roles, true)) {
|
||||
return ApiResponse::error('Forbidden — role not permitted', null, Response::HTTP_FORBIDDEN);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user