--------------------------------------------------------------------------------
Check manually 103 Relying on entity queries to check access by default is
deprecated in drupal:9.2.0 and an error will be thrown from
drupal:10.0.0. Call
\Drupal\Core\Entity\Query\QueryInterface::accessCheck() with
TRUE or FALSE to specify whether access should be checked.
--------------------------------------------------------------------------------
Visit the admin page in drupal 10.
Add $query->accessCheck().
Closed: outdated
1.9
Code