diff --git a/core/authorize.php b/core/authorize.php index 736bab3..7e6be73 100644 --- a/core/authorize.php +++ b/core/authorize.php @@ -53,7 +53,7 @@ function authorize_access_allowed(Request $request) { $account = \Drupal::service('authentication')->authenticate($request); \Drupal::service('current_user')->setAccount($account); - return Settings::get('allow_authorize_operations', TRUE) && \Drupal::currentUser()->hasPermission('administer software updates'); + return Settings::get('allow_authorize_operations', TRUE) && $account->hasPermission('administer software updates'); } try { diff --git a/core/core.services.yml b/core/core.services.yml index 7cf4917..e89766b 100644 --- a/core/core.services.yml +++ b/core/core.services.yml @@ -1080,7 +1080,7 @@ services: class: Drupal\Core\EventSubscriber\AuthenticationSubscriber tags: - { name: event_subscriber } - arguments: ['@authentication', '@current_user'] + arguments: ['@authentication'] account_switcher: class: Drupal\Core\Session\AccountSwitcher arguments: ['@current_user', '@session_manager'] diff --git a/core/lib/Drupal/Core/EventSubscriber/AuthenticationSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/AuthenticationSubscriber.php index ec4ca05..07fa66b 100644 --- a/core/lib/Drupal/Core/EventSubscriber/AuthenticationSubscriber.php +++ b/core/lib/Drupal/Core/EventSubscriber/AuthenticationSubscriber.php @@ -8,10 +8,8 @@ namespace Drupal\Core\EventSubscriber; use Drupal\Core\Authentication\AuthenticationProviderInterface; -use Drupal\Core\Session\AccountProxyInterface; use Symfony\Component\HttpKernel\HttpKernelInterface; use Symfony\Component\HttpKernel\KernelEvents; -use Symfony\Component\HttpKernel\Event\GetResponseEvent; use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent; use Symfony\Component\HttpKernel\Event\FilterResponseEvent; use Symfony\Component\EventDispatcher\EventSubscriberInterface; @@ -31,23 +29,13 @@ class AuthenticationSubscriber implements EventSubscriberInterface { protected $authenticationProvider; /** - * Current user proxy. - * - * @var \Drupal\Core\Session\AccountProxyInterface - */ - protected $currentUser; - - /** * Keep authentication manager as private variable. * * @param AuthenticationProviderInterface $authentication_manager * The authentication manager. - * @param \Drupal\Core\Session\AccountProxyInterface $current_user - * The current user proxy. */ - public function __construct(AuthenticationProviderInterface $authentication_provider, AccountProxyInterface $current_user) { + public function __construct(AuthenticationProviderInterface $authentication_provider) { $this->authenticationProvider = $authentication_provider; - $this->currentUser = $current_user; } /**