You are here

public function VocabularyListBuilder::load in Taxonomy access fix 8

Same name and namespace in other branches
  1. 8.3 src/VocabularyListBuilder.php \Drupal\taxonomy_access_fix\VocabularyListBuilder::load()
  2. 8.2 src/VocabularyListBuilder.php \Drupal\taxonomy_access_fix\VocabularyListBuilder::load()

Override Drupal\Core\Config\Entity\ConfigEntityListBuilder::load().

Overrides ConfigEntityListBuilder::load

File

src/VocabularyListBuilder.php, line 14

Class

VocabularyListBuilder

Namespace

Drupal\taxonomy_access_fix

Code

public function load() {
  $entities = parent::load();

  // Remove vocabularies the current user doesn't have any access for.
  foreach ($entities as $id => $entity) {
    if (!taxonomy_access_fix_access('list terms', $entity)) {
      unset($entities[$id]);
    }
  }
  return $entities;
}