diff --git a/core/lib/Drupal/Core/Entity/EntityAccessCheck.php b/core/lib/Drupal/Core/Entity/EntityAccessCheck.php index 0de9b01417255ca948110baa93a422d8afa28b55..bc8bd5973925ae1a0e28b24a9b525dc880332f3a 100644 --- a/core/lib/Drupal/Core/Entity/EntityAccessCheck.php +++ b/core/lib/Drupal/Core/Entity/EntityAccessCheck.php @@ -17,13 +17,26 @@ class EntityAccessCheck implements AccessInterface { * Checks access to the entity operation on the given route. * * The value of the '_entity_access' key must be in the pattern - * 'entity_type.operation.' The entity type must match the {entity_type} - * parameter in the route pattern. This will check a node for 'update' access: + * 'entity_slug_name.operation.' For example, this will check a node for + * 'update' access: * @code * pattern: '/foo/{node}/bar' * requirements: * _entity_access: 'node.update' * @endcode + * And this will check a dynamic entity type: + * @code + * example.route: + * path: foo/{entity_type}/{example} + * requirements: + * _entity_access: example.update + * options: + * parameters: + * example: + * type: entity:{entity_type} + * @endcode + * @see \Drupal\Core\ParamConverter\EntityConverter + * * Available operations are 'view', 'update', 'create', and 'delete'. * * @param \Symfony\Component\Routing\Route $route