You are here

public function VocabularyListBuilder::load in Vocabulary Permissions Per Role 8

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

Overrides ConfigEntityListBuilder::load

File

src/VocabularyListBuilder.php, line 17

Class

VocabularyListBuilder
Class VocabularyListBuilder.

Namespace

Drupal\vppr

Code

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

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