user(); // Only a genuinely un-migrated legacy admin (is_admin, but NO roles at // all) is promoted — never override an intentional demotion/other role. if ($user instanceof User && $user->is_admin && $user->roles->isEmpty()) { $user->assignRole('Owner'); } abort_unless((bool) $user?->can('console.view'), 403); return $next($request); } }