diff --git a/core/lib/Drupal/Core/Access/AccessInterface.php b/core/lib/Drupal/Core/Access/AccessInterface.php index d37a51f..f555ecb 100644 --- a/core/lib/Drupal/Core/Access/AccessInterface.php +++ b/core/lib/Drupal/Core/Access/AccessInterface.php @@ -11,21 +11,23 @@ use Symfony\Component\Routing\Route; /** - * Provides access check results. + * An access check service determines access rules for particular routes. */ interface AccessInterface { /** * Grant access. * - * A checker should return this value to indicate that it grants access. + * A checker should return this value to indicate that it grants access to a + * route. */ const ALLOW = TRUE; /** * Deny access. * - * A checker should return this value to indicate it does not grant access. + * A checker should return this value to indicate it does not grant access to + * a route. */ const DENY = NULL; @@ -33,9 +35,24 @@ * Block access. * * A checker should return this value to indicate that it wants to completely - * block access, regardless of any other access checkers. Most checkers - * should prefer DENY. + * block access to this route, regardless of any other access checkers. Most + * checkers should prefer DENY. */ const KILL = FALSE; + /** + * Checks for access to a route. + * + * @param \Symfony\Component\Routing\Route $route + * The route to check against. + * @param \Symfony\Component\HttpFoundation\Request $request + * The request object. + * + * @return mixed + * TRUE if access is allowed. + * FALSE if not. + * NULL if no opinion. + */ + public function access(Route $route, Request $request); + } diff --git a/core/lib/Drupal/Core/Access/AccessibleInterface.php b/core/lib/Drupal/Core/Access/AccessibleInterface.php deleted file mode 100644 index faa5a6f..0000000 --- a/core/lib/Drupal/Core/Access/AccessibleInterface.php +++ /dev/null @@ -1,31 +0,0 @@ -createInstance($plugin_id)->access('view', $account); } return TRUE; diff --git a/core/modules/system/entity.api.php b/core/modules/system/entity.api.php index a9123a1..0068427 100644 --- a/core/modules/system/entity.api.php +++ b/core/modules/system/entity.api.php @@ -710,7 +710,7 @@ function hook_entity_operation_alter(array &$operations, \Drupal\Core\Entity\Ent * * @param string $operation * The operation to be performed. See - * \Drupal\Core\Access\AccessibleInterface::access() for possible values. + * \Drupal\Core\TypedData\AccessibleInterface::access() for possible values. * @param \Drupal\Core\Entity\Field\FieldDefinitionInterface $field_definition * The field definition. * @param \Drupal\Core\Session\AccountInterface $account diff --git a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityAccessTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityAccessTest.php index 373c90b..33b2c1a 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityAccessTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityAccessTest.php @@ -9,7 +9,7 @@ use Drupal\Core\Language\Language; use Drupal\Core\Session\AccountInterface; -use Drupal\Core\Access\AccessibleInterface; +use Drupal\Core\TypedData\AccessibleInterface; use Drupal\Core\Entity\EntityAccessController; /** diff --git a/core/modules/user/lib/Drupal/user/Plugin/Search/UserSearch.php b/core/modules/user/lib/Drupal/user/Plugin/Search/UserSearch.php index e4827b6..52ed50b 100644 --- a/core/modules/user/lib/Drupal/user/Plugin/Search/UserSearch.php +++ b/core/modules/user/lib/Drupal/user/Plugin/Search/UserSearch.php @@ -12,7 +12,7 @@ use Drupal\Core\Entity\EntityManager; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Session\AccountInterface; -use Drupal\Core\Access\AccessibleInterface; +use Drupal\Core\TypedData\AccessibleInterface; use Drupal\search\Annotation\SearchPlugin; use Drupal\search\Plugin\SearchPluginBase; use Symfony\Component\DependencyInjection\ContainerInterface; diff --git a/core/modules/views_ui/lib/Drupal/views_ui/ViewUI.php b/core/modules/views_ui/lib/Drupal/views_ui/ViewUI.php index f126ede..6fccced 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/ViewUI.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/ViewUI.php @@ -892,7 +892,7 @@ public function language() { } /** - * {@inheritdoc} + * Implements \Drupal\Core\TypedData\AccessibleInterface::access(). */ public function access($operation = 'view', AccountInterface $account = NULL) { return $this->storage->access($operation, $account); diff --git a/core/tests/Drupal/Tests/Core/Access/AccessManagerTest.php b/core/tests/Drupal/Tests/Core/Access/AccessManagerTest.php index a545cc8..d12f5c0 100644 --- a/core/tests/Drupal/Tests/Core/Access/AccessManagerTest.php +++ b/core/tests/Drupal/Tests/Core/Access/AccessManagerTest.php @@ -8,7 +8,7 @@ namespace Drupal\Tests\Core\Access; use Drupal\Core\Access\AccessCheckInterface; -use Drupal\Core\Routing\Access\AccessInterface; +use Drupal\Core\Access\AccessInterface; use Drupal\Core\Access\AccessManager; use Drupal\Core\Access\DefaultAccessCheck; use Drupal\system\Tests\Routing\MockRouteProvider;