Issue #2821009 by ZeiP, quietone, Dinesh18, shashikant_chauhan, chx, joachim, Berdir, tim.plunkett, Lendude: unclear terminology in EntityAccessCheck::access()

(cherry picked from commit c9f344e4b4)
merge-requests/1862/head^2
Lee Rowlands 2022-02-24 11:01:53 +10:00
parent c6d0179b92
commit 48897c3f2f
No known key found for this signature in database
GPG Key ID: 2B829A3DF9204DC4
1 changed files with 7 additions and 4 deletions

View File

@ -17,8 +17,11 @@ class EntityAccessCheck implements AccessInterface {
* Checks access to the entity operation on the given route.
*
* The route's '_entity_access' requirement must follow the pattern
* 'entity_stub_name.operation', where available operations are:
* 'view', 'update', 'create', and 'delete'.
* 'slug.operation'. Typically, the slug is an entity type ID, but it can be
* any slug defined in the route. The route match parameter corresponding to
* the slug is checked to see if it is entity-like, that is: implements
* EntityInterface. Available operations are: 'view', 'update', 'create', and
* 'delete'.
*
* For example, this route configuration invokes a permissions check for
* 'update' access to entities of type 'node':
@ -38,8 +41,6 @@ class EntityAccessCheck implements AccessInterface {
* example:
* type: entity:{entity_type}
* @endcode
* The route match parameter corresponding to the stub name is checked to
* see if it is entity-like i.e. implements EntityInterface.
*
* @see \Drupal\Core\ParamConverter\EntityConverter
*
@ -52,6 +53,8 @@ class EntityAccessCheck implements AccessInterface {
*
* @return \Drupal\Core\Access\AccessResultInterface
* The access result.
*
* @link https://www.drupal.org/docs/8/api/routing-system/parameters-in-routes
*/
public function access(Route $route, RouteMatchInterface $route_match, AccountInterface $account) {
// Split the entity type and the operation.