VocabularyListBuilder.php in Taxonomy access fix 8.2
File
src/VocabularyListBuilder.php
View source
<?php
namespace Drupal\taxonomy_access_fix;
use Drupal\taxonomy\VocabularyListBuilder as VocabularyListBuilderBase;
class VocabularyListBuilder extends VocabularyListBuilderBase {
public function load() {
$entities = parent::load();
foreach ($entities as $id => $entity) {
if (!$entity
->access('view')) {
unset($entities[$id]);
}
}
return $entities;
}
public function render() {
if (!$this->currentUser
->hasPermission('administer taxonomy')) {
unset($this->weightKey);
}
return parent::render();
}
}