diff --git a/core/lib/Drupal/Core/Access/AccessInterface.php b/core/lib/Drupal/Core/Access/AccessInterface.php index f555ecb..d37a51f 100644 --- a/core/lib/Drupal/Core/Access/AccessInterface.php +++ b/core/lib/Drupal/Core/Access/AccessInterface.php @@ -11,23 +11,21 @@ use Symfony\Component\Routing\Route; /** - * An access check service determines access rules for particular routes. + * Provides access check results. */ interface AccessInterface { /** * Grant access. * - * A checker should return this value to indicate that it grants access to a - * route. + * A checker should return this value to indicate that it grants access. */ const ALLOW = TRUE; /** * Deny access. * - * A checker should return this value to indicate it does not grant access to - * a route. + * A checker should return this value to indicate it does not grant access. */ const DENY = NULL; @@ -35,24 +33,9 @@ * Block access. * * A checker should return this value to indicate that it wants to completely - * block access to this route, regardless of any other access checkers. Most - * checkers should prefer DENY. + * block access, 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 new file mode 100644 index 0000000..faa5a6f --- /dev/null +++ b/core/lib/Drupal/Core/Access/AccessibleInterface.php @@ -0,0 +1,31 @@ +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 e44f2d3..19b57c2 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\TypedData\AccessibleInterface::access() for possible values. + * \Drupal\Core\Access\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 33b2c1a..373c90b 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\TypedData\AccessibleInterface; +use Drupal\Core\Access\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 52ed50b..e4827b6 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\TypedData\AccessibleInterface; +use Drupal\Core\Access\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 3de8091..9f76db6 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() { } /** - * Implements \Drupal\Core\TypedData\AccessibleInterface::access(). + * {@inheritdoc} */ 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 097cdd3..2c07870 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\Access\AccessInterface; +use Drupal\Core\Routing\Access\AccessInterface; use Drupal\Core\Access\AccessManager; use Drupal\Core\Access\DefaultAccessCheck; use Drupal\system\Tests\Routing\MockRouteProvider;