Skip to content
Snippets Groups Projects

Issue #3472119: Add ::accessCheck() to entity queries

Merged Liam Morland requested to merge issue/wxt-3472119:3472119-add-accesscheck-to into 5.3.x
@@ -104,7 +104,7 @@ public function tearDown() {
public function visitEntity($entity_type, $bundle = NULL) {
$storage = \Drupal::entityTypeManager()->getStorage($entity_type);
$query = $storage->getQuery();
$query = $storage->getQuery()->accessCheck(TRUE);
if ($bundle) {
$key = $storage->getEntityType()->getKey('bundle');
@@ -166,7 +166,7 @@ public function trashNewest($entity_type, $n = 1) {
private function count($entity_type, $bundle = NULL) {
$storage = \Drupal::entityTypeManager()->getStorage($entity_type);
$query = $storage->getQuery()->count();
$query = $storage->getQuery()->accessCheck(TRUE)->count();
if ($bundle) {
$query->condition($storage->getEntityType()->getKey('bundle'), $bundle);
Loading