class EntityAccessCheck contains incorrect and inconsistent example.

  /**
   * Checks access to the entity operation on the given route.
   *
   * The route's '_entity_access' requirement must follow the pattern
   * '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':
   * @code
   * pattern: '/foo/{node}/bar'
   * requirements:
   *   _entity_access: 'node.update'
   * @endcode
   *
   * And this will check 'delete' access to a dynamic entity type:
   *
   * @code
   * example.route:
   *   path: foo/{entity_type}/{example}
   *   requirements:
   *     _entity_access: example.delete
   *   options:
   *     parameters:
   *       example:
   *         type: entity:{entity_type}
   * @endcode
   *

Issue fork drupal-3484799

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

vladimiraus created an issue. See original summary.

vladimiraus’s picture

Version: 11.0.x-dev » 11.x-dev

vladimiraus’s picture

Assigned: vladimiraus » Unassigned
Status: Active » Needs review
vladimiraus’s picture

Issue tags: +Documentation
jannakha’s picture

Status: Needs review » Reviewed & tested by the community

thanks for the fix!

alexpott’s picture

Version: 11.x-dev » 10.3.x-dev
Status: Reviewed & tested by the community » Fixed

Backported to 10.3.x as a docs fix.

Committed and pushed d3ba876d324 to 11.x and 529f579d084 to 11.1.x and 99ca4cf58ce to 11.0.x and e6da6632568 to 10.5.x and 6ea3299f969 to 10.4.x and 8c90792a8d2 to 10.3.x. Thanks!

  • alexpott committed 8c90792a on 10.3.x
    Issue #3484799 by vladimiraus: EntityAccessCheck documentation contains...

  • alexpott committed 6ea3299f on 10.4.x
    Issue #3484799 by vladimiraus: EntityAccessCheck documentation contains...

  • alexpott committed e6da6632 on 10.5.x
    Issue #3484799 by vladimiraus: EntityAccessCheck documentation contains...

  • alexpott committed 99ca4cf5 on 11.0.x
    Issue #3484799 by vladimiraus: EntityAccessCheck documentation contains...

  • alexpott committed 529f579d on 11.1.x
    Issue #3484799 by vladimiraus: EntityAccessCheck documentation contains...

  • alexpott committed d3ba876d on 11.x
    Issue #3484799 by vladimiraus: EntityAccessCheck documentation contains...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.