See parent issue #3200985: [meta] Fix undesirable access checking on entity query usages for context and test coverage policy. This issue is major because it blocks #2785449: It's too easy to write entity queries with access checks that must not have them.
We are moving to require accessCheck() to be called on content entity queries. There are a number of entity queries in core that currently correctly check access, but rely on the default behavior being accessCheck(TRUE). This issue changes these to explicitly specify the accessCheck.
Fixes needed:
- core/lib/Drupal/Core/Entity/EntityListBuilder.php
- core/lib/Drupal/Core/Entity/Plugin/EntityReferenceSelection/DefaultSelection.php
- core/lib/Drupal/Core/Field/EntityReferenceFieldItemList.php
- core/lib/Drupal/Core/Menu/DefaultMenuLinkTreeManipulators.php
- core/modules/comment/src/Form/CommentAdminOverview.php
- core/modules/media/src/MediaListBuilder.php
- core/modules/node/src/Controller/NodeController.php
- core/modules/path/src/PathAliasListBuilder.php
- core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php
- core/modules/taxonomy/taxonomy.tokens.inc
- core/modules/user/src/UserListBuilder.php
- core/modules/aggregator/src/Plugin/Block/AggregatorFeedBlock.php
- core/modules/comment/src/CommentManager.php getCountNewComments
Issue fork drupal-3204419
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
Comment #2
jonathanshawComment #4
jonathanshawI love how there's only 13 cases here where we got accessCheck(TRUE) right and 200+ in other child issues where it should be accessCheck(FALSE).
Comment #5
jonathanshawComment #6
longwaveThis is just reinforcing the existing behaviour before we enforce accessCheck(), all checks are set to TRUE so this is fine.
Comment #9
catchCommitted/pushed to 9.2.x and cherry-picked to 9.1.x, thanks!