Issue #2778809 by chx: _entity_access is actually usable but you'd never tell that from the class doxygen
parent
8658fc3baf
commit
03f46efe54
|
@ -17,13 +17,26 @@ class EntityAccessCheck implements AccessInterface {
|
||||||
* Checks access to the entity operation on the given route.
|
* Checks access to the entity operation on the given route.
|
||||||
*
|
*
|
||||||
* The value of the '_entity_access' key must be in the pattern
|
* The value of the '_entity_access' key must be in the pattern
|
||||||
* 'entity_type.operation.' The entity type must match the {entity_type}
|
* 'entity_slug_name.operation.' For example, this will check a node for
|
||||||
* parameter in the route pattern. This will check a node for 'update' access:
|
* 'update' access:
|
||||||
* @code
|
* @code
|
||||||
* pattern: '/foo/{node}/bar'
|
* pattern: '/foo/{node}/bar'
|
||||||
* requirements:
|
* requirements:
|
||||||
* _entity_access: 'node.update'
|
* _entity_access: 'node.update'
|
||||||
* @endcode
|
* @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'.
|
* Available operations are 'view', 'update', 'create', and 'delete'.
|
||||||
*
|
*
|
||||||
* @param \Symfony\Component\Routing\Route $route
|
* @param \Symfony\Component\Routing\Route $route
|
||||||
|
|
Loading…
Reference in New Issue