Commit 4a45c16b authored by alexpott's avatar alexpott

Issue #2310705 by lokeoke, tim.plunkett, dawehner: AccessManager should...

Issue #2310705 by lokeoke, tim.plunkett, dawehner: AccessManager should introduce constants for 'ANY' / 'ALL'.
parent 9bbfedec
......@@ -51,8 +51,8 @@ protected function getArgument(\ReflectionParameter $parameter, Route $route, Re
$parameter_type_hint = $parameter->getClass();
$parameter_name = $parameter->getName();
// @todo Remove this once AccessManager::checkNamedRoute() is fixed to not
// leak _raw_variables from the request being duplicated.
// @todo Remove this once AccessManagerInterface::checkNamedRoute() is fixed
// to not leak _raw_variables from the request being duplicated.
// @see https://drupal.org/node/2265939
$raw_route_arguments += $upcasted_route_arguments;
......
......@@ -27,7 +27,7 @@
*
* @see \Drupal\Tests\Core\Access\AccessManagerTest
*/
class AccessManager implements ContainerAwareInterface {
class AccessManager implements ContainerAwareInterface, AccessManagerInterface {
use ContainerAwareTrait;
......@@ -124,15 +124,7 @@ public function __construct(RouteProviderInterface $route_provider, UrlGenerator
}
/**
* Registers a new AccessCheck by service ID.
*
* @param string $service_id
* The ID of the service in the Container that provides a check.
* @param string $service_method
* The method to invoke on the service object for performing the check.
* @param array $applies_checks
* (optional) An array of route requirement keys the checker service applies
* to.
* {@inheritdoc}
*/
public function addCheckService($service_id, $service_method, array $applies_checks = array()) {
$this->checkIds[] = $service_id;
......@@ -143,10 +135,7 @@ public function addCheckService($service_id, $service_method, array $applies_che
}
/**
* For each route, saves a list of applicable access checks to the route.
*
* @param \Symfony\Component\Routing\RouteCollection $routes
* A collection of routes to apply checks to.
* {@inheritdoc}
*/
public function setChecks(RouteCollection $routes) {
$this->loadDynamicRequirementMap();
......@@ -190,22 +179,7 @@ protected function applies(Route $route) {
}
/**
* Checks a named route with parameters against applicable access check services.
*
* Determines whether the route is accessible or not.
*
* @param string $route_name
* The route to check access to.
* @param array $parameters
* Optional array of values to substitute into the route path patern.
* @param \Drupal\Core\Session\AccountInterface $account
* The current user.
* @param \Symfony\Component\HttpFoundation\Request $route_request
* Optional incoming request object. If not provided, one will be built
* using the route information and the current request from the container.
*
* @return bool
* Returns TRUE if the user has access to the route, otherwise FALSE.
* {@inheritdoc}
*/
public function checkNamedRoute($route_name, array $parameters = array(), AccountInterface $account, Request $route_request = NULL) {
try {
......@@ -228,25 +202,13 @@ public function checkNamedRoute($route_name, array $parameters = array(), Accoun
}
/**
* Checks a route against applicable access check services.
*
* Determines whether the route is accessible or not.
*
* @param \Symfony\Component\Routing\Route $route
* The route to check access to.
* @param \Symfony\Component\HttpFoundation\Request $request
* The incoming request object.
* @param \Drupal\Core\Session\AccountInterface $account
* The current account.
*
* @return bool
* Returns TRUE if the user has access to the route, otherwise FALSE.
* {@inheritdoc}
*/
public function check(Route $route, Request $request, AccountInterface $account) {
$checks = $route->getOption('_access_checks') ?: array();
$conjunction = $route->getOption('_access_mode') ?: 'ALL';
$conjunction = $route->getOption('_access_mode') ?: static::ACCESS_MODE_ALL;
if ($conjunction == 'ALL') {
if ($conjunction == static::ACCESS_MODE_ALL) {
return $this->checkAll($checks, $route, $request, $account);
}
else {
......@@ -390,7 +352,7 @@ protected function loadCheck($service_id) {
/**
* Compiles a mapping of requirement keys to access checker service IDs.
*/
public function loadDynamicRequirementMap() {
protected function loadDynamicRequirementMap() {
if (isset($this->dynamicRequirementMap)) {
return;
}
......
<?php
/**
* @file
* Contains \Drupal\Core\Access\AccessManagerInterface.
*/
namespace Drupal\Core\Access;
use Symfony\Component\Routing\Route;
use Symfony\Component\Routing\RouteCollection;
use Symfony\Component\HttpFoundation\Request;
use Drupal\Core\Session\AccountInterface;
/**
* Provides an interface for attaching and running access check services.
*/
interface AccessManagerInterface {
/**
* All access checkers have to return AccessInterface::ALLOW.
*
* self::ACCESS_MODE_ALL is the default behavior.
*
* @see \Drupal\Core\Access\AccessInterface::ALLOW
*/
const ACCESS_MODE_ALL = 'ALL';
/**
* At least one access checker has to return AccessInterface::ALLOW
* and none should return AccessInterface::KILL.
*
* @see \Drupal\Core\Access\AccessInterface::ALLOW
* @see \Drupal\Core\Access\AccessInterface::KILL
*/
const ACCESS_MODE_ANY = 'ANY';
/**
* Checks a named route with parameters against applicable access check services.
*
* Determines whether the route is accessible or not.
*
* @param string $route_name
* The route to check access to.
* @param array $parameters
* Optional array of values to substitute into the route path patern.
* @param \Drupal\Core\Session\AccountInterface $account
* The current user.
* @param \Symfony\Component\HttpFoundation\Request $route_request
* Optional incoming request object. If not provided, one will be built
* using the route information and the current request from the container.
*
* @return bool
* Returns TRUE if the user has access to the route, otherwise FALSE.
*/
public function checkNamedRoute($route_name, array $parameters = array(), AccountInterface $account, Request $route_request = NULL);
/**
* For each route, saves a list of applicable access checks to the route.
*
* @param \Symfony\Component\Routing\RouteCollection $routes
* A collection of routes to apply checks to.
*/
public function setChecks(RouteCollection $routes);
/**
* Registers a new AccessCheck by service ID.
*
* @param string $service_id
* The ID of the service in the Container that provides a check.
* @param string $service_method
* The method to invoke on the service object for performing the check.
* @param array $applies_checks
* (optional) An array of route requirement keys the checker service applies
* to.
*/
public function addCheckService($service_id, $service_method, array $applies_checks = array());
/**
* Checks a route against applicable access check services.
*
* Determines whether the route is accessible or not.
*
* @param \Symfony\Component\Routing\Route $route
* The route to check access to.
* @param \Symfony\Component\HttpFoundation\Request $request
* The incoming request object.
* @param \Drupal\Core\Session\AccountInterface $account
* The current account.
*
* @return bool
* Returns TRUE if the user has access to the route, otherwise FALSE.
*/
public function check(Route $route, Request $request, AccountInterface $account);
}
......@@ -58,9 +58,9 @@ public function access(Route $route, Request $request) {
// Otherwise, this could be another requested access check that we don't
// want to check CSRF tokens on.
$conjunction = $route->getOption('_access_mode') ?: 'ANY';
$conjunction = $route->getOption('_access_mode') ?: AccessManagerInterface::ACCESS_MODE_ANY;
// Return ALLOW if all access checks are needed.
if ($conjunction == 'ALL') {
if ($conjunction == AccessManagerInterface::ACCESS_MODE_ALL) {
return static::ALLOW;
}
// Return DENY otherwise, as another access checker should grant access
......
......@@ -7,7 +7,7 @@
namespace Drupal\Core\EventSubscriber;
use Drupal\Core\Access\AccessManager;
use Drupal\Core\Access\AccessManagerInterface;
use Drupal\Core\Routing\RouteBuildEvent;
use Drupal\Core\Routing\RoutingEvents;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
......@@ -20,18 +20,18 @@ class AccessRouteSubscriber implements EventSubscriberInterface {
/**
* The access manager.
*
* @var \Drupal\Core\Access\AccessManager
* @var \Drupal\Core\Access\AccessManagerInterface
*/
protected $accessManager;
/**
* Constructs a new AccessSubscriber.
*
* @param \Drupal\Core\Access\AccessManager $access_manager
* @param \Drupal\Core\Access\AccessManagerInterface $access_manager
* The access check manager that will be responsible for applying
* AccessCheckers against routes.
*/
public function __construct(AccessManager $access_manager) {
public function __construct(AccessManagerInterface $access_manager) {
$this->accessManager = $access_manager;
}
......
......@@ -7,7 +7,7 @@
namespace Drupal\Core\EventSubscriber;
use Drupal\Core\Access\AccessManager;
use Drupal\Core\Access\AccessManagerInterface;
use Drupal\Core\Session\AccountInterface;
use Symfony\Cmf\Component\Routing\RouteObjectInterface;
use Symfony\Component\HttpKernel\KernelEvents;
......@@ -31,20 +31,20 @@ class AccessSubscriber implements EventSubscriberInterface {
/**
* The access manager.
*
* @var \Drupal\Core\Access\AccessManager
* @var \Drupal\Core\Access\AccessManagerInterface
*/
protected $accessManager;
/**
* Constructs a new AccessSubscriber.
*
* @param \Drupal\Core\Access\AccessManager $access_manager
* @param \Drupal\Core\Access\AccessManagerInterface $access_manager
* The access check manager that will be responsible for applying
* AccessCheckers against routes.
* @param \Drupal\Core\Session\AccountInterface $current_user
* The current user.
*/
public function __construct(AccessManager $access_manager, AccountInterface $current_user) {
public function __construct(AccessManagerInterface $access_manager, AccountInterface $current_user) {
$this->accessManager = $access_manager;
$this->currentUser = $current_user;
}
......
......@@ -8,7 +8,7 @@
namespace Drupal\Core\Menu;
use Drupal\Component\Plugin\Exception\PluginException;
use Drupal\Core\Access\AccessManager;
use Drupal\Core\Access\AccessManagerInterface;
use Drupal\Core\Cache\CacheBackendInterface;
use Drupal\Core\Controller\ControllerResolverInterface;
use Drupal\Core\Extension\ModuleHandlerInterface;
......@@ -59,7 +59,7 @@ class ContextualLinkManager extends DefaultPluginManager implements ContextualLi
/**
* The access manager.
*
* @var \Drupal\Core\Access\AccessManager
* @var \Drupal\Core\Access\AccessManagerInterface
*/
protected $accessManager;
......@@ -95,14 +95,14 @@ class ContextualLinkManager extends DefaultPluginManager implements ContextualLi
* The cache backend.
* @param \Drupal\Core\Language\LanguageManager $language_manager
* The language manager.
* @param \Drupal\Core\Access\AccessManager $access_manager
* @param \Drupal\Core\Access\AccessManagerInterface $access_manager
* The access manager.
* @param \Drupal\Core\Session\AccountInterface $account
* The current user.
* @param \Symfony\Component\HttpFoundation\RequestStack $request_stack
* The request stack.
*/
public function __construct(ControllerResolverInterface $controller_resolver, ModuleHandlerInterface $module_handler, CacheBackendInterface $cache_backend, LanguageManager $language_manager, AccessManager $access_manager, AccountInterface $account, RequestStack $request_stack) {
public function __construct(ControllerResolverInterface $controller_resolver, ModuleHandlerInterface $module_handler, CacheBackendInterface $cache_backend, LanguageManager $language_manager, AccessManagerInterface $access_manager, AccountInterface $account, RequestStack $request_stack) {
$this->discovery = new YamlDiscovery('links.contextual', $module_handler->getModuleDirectories());
$this->discovery = new ContainerDerivativeDiscoveryDecorator($this->discovery);
$this->factory = new ContainerFactory($this);
......
......@@ -7,7 +7,7 @@
namespace Drupal\Core\Menu;
use Drupal\Core\Access\AccessManager;
use Drupal\Core\Access\AccessManagerInterface;
use Drupal\Core\Session\AccountInterface;
/**
......@@ -24,7 +24,7 @@ class DefaultMenuLinkTreeManipulators {
/**
* The access manager.
*
* @var \Drupal\Core\Access\AccessManager
* @var \Drupal\Core\Access\AccessManagerInterface
*/
protected $accessManager;
......@@ -38,12 +38,12 @@ class DefaultMenuLinkTreeManipulators {
/**
* Constructs a \Drupal\Core\Menu\DefaultMenuLinkTreeManipulators object.
*
* @param \Drupal\Core\Access\AccessManager $access_manager
* @param \Drupal\Core\Access\AccessManagerInterface $access_manager
* The access manager.
* @param \Drupal\Core\Session\AccountInterface $account
* The current user.
*/
public function __construct(AccessManager $access_manager, AccountInterface $account) {
public function __construct(AccessManagerInterface $access_manager, AccountInterface $account) {
$this->accessManager = $access_manager;
$this->account = $account;
}
......
......@@ -7,7 +7,7 @@
namespace Drupal\Core\Menu;
use Drupal\Core\Access\AccessManager;
use Drupal\Core\Access\AccessManagerInterface;
use Drupal\Core\Cache\CacheBackendInterface;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Language\LanguageManagerInterface;
......@@ -78,7 +78,7 @@ class LocalActionManager extends DefaultPluginManager {
/**
* The access manager.
*
* @var \Drupal\Core\Access\AccessManager
* @var \Drupal\Core\Access\AccessManagerInterface
*/
protected $accessManager;
......@@ -111,12 +111,12 @@ class LocalActionManager extends DefaultPluginManager {
* Cache backend instance to use.
* @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
* The language manager.
* @param \Drupal\Core\Access\AccessManager $access_manager
* @param \Drupal\Core\Access\AccessManagerInterface $access_manager
* The access manager.
* @param \Drupal\Core\Session\AccountInterface $account
* The current user.
*/
public function __construct(ControllerResolverInterface $controller_resolver, RequestStack $request_stack, RouteProviderInterface $route_provider, ModuleHandlerInterface $module_handler, CacheBackendInterface $cache_backend, LanguageManagerInterface $language_manager, AccessManager $access_manager, AccountInterface $account) {
public function __construct(ControllerResolverInterface $controller_resolver, RequestStack $request_stack, RouteProviderInterface $route_provider, ModuleHandlerInterface $module_handler, CacheBackendInterface $cache_backend, LanguageManagerInterface $language_manager, AccessManagerInterface $access_manager, AccountInterface $account) {
// Skip calling the parent constructor, since that assumes annotation-based
// discovery.
$this->discovery = new YamlDiscovery('links.action', $module_handler->getModuleDirectories());
......
......@@ -8,7 +8,7 @@
namespace Drupal\Core\Menu;
use Drupal\Component\Plugin\Exception\PluginException;
use Drupal\Core\Access\AccessManager;
use Drupal\Core\Access\AccessManagerInterface;
use Drupal\Core\Cache\Cache;
use Drupal\Core\Cache\CacheBackendInterface;
use Drupal\Core\Controller\ControllerResolverInterface;
......@@ -94,7 +94,7 @@ class LocalTaskManager extends DefaultPluginManager {
/**
* The access manager.
*
* @var \Drupal\Core\Access\AccessManager
* @var \Drupal\Core\Access\AccessManagerInterface
*/
protected $accessManager;
......@@ -122,12 +122,12 @@ class LocalTaskManager extends DefaultPluginManager {
* The cache backend.
* @param \Drupal\Core\Language\LanguageManager $language_manager
* The language manager.
* @param \Drupal\Core\Access\AccessManager $access_manager
* @param \Drupal\Core\Access\AccessManagerInterface $access_manager
* The access manager.
* @param \Drupal\Core\Session\AccountInterface $account
* The current user.
*/
public function __construct(ControllerResolverInterface $controller_resolver, RequestStack $request_stack, RouteProviderInterface $route_provider, RouteBuilderInterface $route_builder, ModuleHandlerInterface $module_handler, CacheBackendInterface $cache, LanguageManager $language_manager, AccessManager $access_manager, AccountInterface $account) {
public function __construct(ControllerResolverInterface $controller_resolver, RequestStack $request_stack, RouteProviderInterface $route_provider, RouteBuilderInterface $route_builder, ModuleHandlerInterface $module_handler, CacheBackendInterface $cache, LanguageManager $language_manager, AccessManagerInterface $access_manager, AccountInterface $account) {
$this->discovery = new YamlDiscovery('links.task', $module_handler->getModuleDirectories());
$this->discovery = new ContainerDerivativeDiscoveryDecorator($this->discovery);
$this->factory = new ContainerFactory($this);
......
......@@ -8,7 +8,7 @@
namespace Drupal\Core\Path;
use Drupal\Component\Utility\UrlHelper;
use Drupal\Core\Access\AccessManager;
use Drupal\Core\Access\AccessManagerInterface;
use Drupal\Core\ParamConverter\ParamNotConvertedException;
use Drupal\Core\Routing\RequestHelper;
use Drupal\Core\Routing\RouteProviderInterface;
......@@ -45,7 +45,7 @@ class PathValidator implements PathValidatorInterface {
/**
* The access manager.
*
* @var \Drupal\Core\Access\AccessManager
* @var \Drupal\Core\Access\AccessManagerInterface
*/
protected $accessManager;
......@@ -65,12 +65,12 @@ class PathValidator implements PathValidatorInterface {
* The route provider.
* @param \Symfony\Component\HttpFoundation\RequestStack $request_stack
* The request stack.
* @param \Drupal\Core\Access\AccessManager $access_manager
* @param \Drupal\Core\Access\AccessManagerInterface $access_manager
* The access manager.
* @param \Drupal\Core\Session\AccountInterface $account
* The user account.
*/
public function __construct(RequestMatcherInterface $request_matcher, RouteProviderInterface $route_provider, RequestStack $request_stack, AccessManager $access_manager, AccountInterface $account) {
public function __construct(RequestMatcherInterface $request_matcher, RouteProviderInterface $route_provider, RequestStack $request_stack, AccessManagerInterface $access_manager, AccountInterface $account) {
$this->requestMatcher = $request_matcher;
$this->routeProvider = $route_provider;
$this->requestStack = $request_stack;
......
......@@ -7,7 +7,7 @@
namespace Drupal\book;
use Drupal\Core\Access\AccessManager;
use Drupal\Core\Access\AccessManagerInterface;
use Drupal\Core\Breadcrumb\BreadcrumbBuilderInterface;
use Drupal\Core\Entity\EntityManagerInterface;
use Drupal\Core\Routing\LinkGeneratorTrait;
......@@ -33,7 +33,7 @@ class BookBreadcrumbBuilder implements BreadcrumbBuilderInterface {
/**
* The access manager.
*
* @var \Drupal\Core\Access\AccessManager
* @var \Drupal\Core\Access\AccessManagerInterface
*/
protected $accessManager;
......@@ -49,12 +49,12 @@ class BookBreadcrumbBuilder implements BreadcrumbBuilderInterface {
*
* @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
* The entity manager service.
* @param \Drupal\Core\Access\AccessManager $access_manager
* @param \Drupal\Core\Access\AccessManagerInterface $access_manager
* The access manager.
* @param \Drupal\Core\Session\AccountInterface $account
* The current user account.
*/
public function __construct(EntityManagerInterface $entity_manager, AccessManager $access_manager, AccountInterface $account) {
public function __construct(EntityManagerInterface $entity_manager, AccessManagerInterface $access_manager, AccountInterface $account) {
$this->nodeStorage = $entity_manager->getStorage('node');
$this->accessManager = $access_manager;
$this->account = $account;
......
......@@ -8,7 +8,7 @@
namespace Drupal\config_translation\Controller;
use Drupal\config_translation\ConfigMapperManagerInterface;
use Drupal\Core\Access\AccessManager;
use Drupal\Core\Access\AccessManagerInterface;
use Drupal\Core\Controller\ControllerBase;
use Drupal\Core\Language\Language;
use Drupal\Core\Language\LanguageManagerInterface;
......@@ -36,7 +36,7 @@ class ConfigTranslationController extends ControllerBase {
/**
* The menu link access service.
*
* @var \Drupal\Core\Access\AccessManager
* @var \Drupal\Core\Access\AccessManagerInterface
*/
protected $accessManager;
......@@ -73,7 +73,7 @@ class ConfigTranslationController extends ControllerBase {
*
* @param \Drupal\config_translation\ConfigMapperManagerInterface $config_mapper_manager
* The configuration mapper manager.
* @param \Drupal\Core\Access\AccessManager $access_manager
* @param \Drupal\Core\Access\AccessManagerInterface $access_manager
* The menu link access service.
* @param \Symfony\Component\Routing\Matcher\RequestMatcherInterface $router
* The dynamic router service.
......@@ -84,7 +84,7 @@ class ConfigTranslationController extends ControllerBase {
* @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
* The language manager.
*/
public function __construct(ConfigMapperManagerInterface $config_mapper_manager, AccessManager $access_manager, RequestMatcherInterface $router, InboundPathProcessorInterface $path_processor, AccountInterface $account, LanguageManagerInterface $language_manager) {
public function __construct(ConfigMapperManagerInterface $config_mapper_manager, AccessManagerInterface $access_manager, RequestMatcherInterface $router, InboundPathProcessorInterface $path_processor, AccountInterface $account, LanguageManagerInterface $language_manager) {
$this->configMapperManager = $config_mapper_manager;
$this->accessManager = $access_manager;
$this->router = $router;
......
......@@ -7,7 +7,7 @@
namespace Drupal\contact\Plugin\views\field;
use Drupal\Core\Access\AccessManager;
use Drupal\Core\Access\AccessManagerInterface;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Session\AccountInterface;
use Drupal\user\Plugin\views\field\Link;
......@@ -26,7 +26,7 @@ class ContactLink extends Link {
/**
* The access manager.
*
* @var \Drupal\Core\Access\AccessManager
* @var \Drupal\Core\Access\AccessManagerInterface
*/
protected $accessManager;
......@@ -61,10 +61,10 @@ protected function currentUser() {
* The plugin_id for the plugin instance.
* @param mixed $plugin_definition
* The plugin implementation definition.
* @param \Drupal\Core\Access\AccessManager $access_manager
* @param \Drupal\Core\Access\AccessManagerInterface $access_manager
* The access manager.
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, AccessManager $access_manager) {
public function __construct(array $configuration, $plugin_id, $plugin_definition, AccessManagerInterface $access_manager) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->accessManager = $access_manager;
}
......
......@@ -8,6 +8,7 @@
namespace Drupal\content_translation\Routing;
use Drupal\content_translation\ContentTranslationManagerInterface;
use Drupal\Core\Access\AccessManagerInterface;
use Drupal\Core\Routing\RouteSubscriberBase;
use Drupal\Core\Routing\RoutingEvents;
use Symfony\Component\Routing\Route;
......@@ -63,7 +64,7 @@ protected function alterRoutes(RouteCollection $collection) {
'_permission' => 'translate any entity',
),
array(
'_access_mode' => 'ANY',
'_access_mode' => AccessManagerInterface::ACCESS_MODE_ANY,
'parameters' => array(
'entity' => array(
'type' => 'entity:' . $entity_type_id,
......@@ -92,7 +93,7 @@ protected function alterRoutes(RouteCollection $collection) {
'_access_content_translation_manage' => 'create',
),
array(
'_access_mode' => 'ANY',
'_access_mode' => AccessManagerInterface::ACCESS_MODE_ANY,
'parameters' => array(
'entity' => array(
'type' => 'entity:' . $entity_type_id,
......@@ -119,7 +120,7 @@ protected function alterRoutes(RouteCollection $collection) {
'_access_content_translation_manage' => 'update',
),
array(
'_access_mode' => 'ANY',
'_access_mode' => AccessManagerInterface::ACCESS_MODE_ANY,
'parameters' => array(
'entity' => array(
'type' => 'entity:' . $entity_type_id,
......@@ -154,7 +155,7 @@ protected function alterRoutes(RouteCollection $collection) {
'type' => 'entity:' . $entity_type_id,
),
),
'_access_mode' => 'ANY',
'_access_mode' => AccessManagerInterface::ACCESS_MODE_ANY,
'_admin_route' => $is_admin,
)
);
......
......@@ -8,7 +8,7 @@
namespace Drupal\menu_link_content\Form;
use Drupal\Component\Utility\UrlHelper;
use Drupal\Core\Access\AccessManager;
use Drupal\Core\Access\AccessManagerInterface;
use Drupal\Core\Entity\ContentEntityForm;
use Drupal\Core\Entity\EntityManagerInterface;
use Drupal\Core\Extension\ModuleHandlerInterface;
......@@ -65,7 +65,7 @@ class MenuLinkContentForm extends ContentEntityForm implements MenuLinkFormInter
/**
* The access manager.
*
* @var \Drupal\Core\Access\AccessManager
* @var \Drupal\Core\Access\AccessManagerInterface
*/
protected $accessManager;
......@@ -91,12 +91,12 @@ class MenuLinkContentForm extends ContentEntityForm implements MenuLinkFormInter
* The request context.
* @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
* The language manager.
* @param \Drupal\Core\Access\AccessManager $access_manager
* @param \Drupal\Core\Access\AccessManagerInterface $access_manager
* The access manager.
* @param \Drupal\Core\Session\AccountInterface $account
* The current user.
*/
public function __construct(EntityManagerInterface $entity_manager, MenuParentFormSelectorInterface $menu_parent_selector, AliasManagerInterface $alias_manager, ModuleHandlerInterface $module_handler, RequestContext $request_context, LanguageManagerInterface $language_manager, AccessManager $access_manager, AccountInterface $account) {
public function __construct(EntityManagerInterface $entity_manager, MenuParentFormSelectorInterface $menu_parent_selector, AliasManagerInterface $alias_manager, ModuleHandlerInterface $module_handler, RequestContext $request_context, LanguageManagerInterface $language_manager, AccessManagerInterface $access_manager, AccountInterface $account) {
parent::__construct($entity_manager, $language_manager);
$this->menuParentSelector = $menu_parent_selector;
$this->pathAliasManager = $alias_manager;
......
......@@ -6,7 +6,7 @@
namespace Drupal\menu_link_content;
use Drupal\Core\Access\AccessManager;
use Drupal\Core\Access\AccessManagerInterface;
use Drupal\Core\Entity\EntityControllerInterface;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityAccessController;
......@@ -22,7 +22,7 @@ class MenuLinkContentAccessController extends EntityAccessController implements
/**
* The access manager to check routes by name.
*
* @var \Drupal\Core\Access\AccessManager
* @var \Drupal\Core\Access\AccessManagerInterface
*/
protected $accessManager;
......@@ -31,10 +31,10 @@ class MenuLinkContentAccessController extends EntityAccessController implements
*
* @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
* The entity type definition.
* @param \Drupal\Core\Access\AccessManager $access_manager
* @param \Drupal\Core\Access\AccessManagerInterface $access_manager
* The access manager to check routes by name.
*/
public function __construct(EntityTypeInterface $entity_type, AccessManager $access_manager) {
public function __construct(EntityTypeInterface $entity_type, AccessManagerInterface $access_manager) {
parent::__construct($entity_type);
$this->accessManager = $access_manager;
......
......@@ -7,7 +7,7 @@
namespace Drupal\node\Plugin\views\area;
use Drupal\Core\Access\AccessManager;
use Drupal\Core\Access\AccessManagerInterface;
use Drupal\views\Plugin\views\area\AreaPluginBase;
use Symfony\Component\DependencyInjection\ContainerInterface;
......@@ -23,7 +23,7 @@ class ListingEmpty extends AreaPluginBase {
/**
* The access manager.
*
* @var \Drupal\Core\Access\AccessManager
* @var \Drupal\Core\Access\AccessManagerInterface
*/
protected $accessManager