protected function handleAccess(Request
$request) { /** @var \Drupal\Core\Authentication\AuthenticationManager $authentication_manager */
$authentication_manager =
$this->
getContainer()->
get('authentication'
);
$account =
$authentication_manager->
authenticate($request) ?:
new AnonymousUserSession();
/** @var \Drupal\Core\Session\AccountProxyInterface $current_user */
$current_user =
$this->
getContainer()->
get('current_user'
);
$current_user->
setAccount($account);
/** @var \Drupal\system\Access\DbUpdateAccessCheck $db_update_access */
$db_update_access =
$this->
getContainer()->
get('access_check.db_update'
);
if (!Settings::
get('update_free_access', FALSE
) && !
$db_update_access->
access($account)->
isAllowed()) { throw new AccessDeniedHttpException('In order to run update.php you need to either have "Administer software updates" permission or have set $settings[\'update_free_access\'] in your settings.php.'
);
} }