diff --git a/core/modules/forum/src/Form/Overview.php b/core/modules/forum/src/Form/Overview.php index abeb681..034cab1 100644 --- a/core/modules/forum/src/Form/Overview.php +++ b/core/modules/forum/src/Form/Overview.php @@ -65,7 +65,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { if (isset($form['terms'][$key]['#term'])) { $term = $form['terms'][$key]['#term']; $form['terms'][$key]['term']['#url'] = Url::fromRoute('forum.page', ['taxonomy_term' => $term->id()]); - if($form['terms'][$key]['#term']->access('delete')) { + if ($form['terms'][$key]['#term']->access('delete')) { unset($form['terms'][$key]['operations']['#links']['delete']); } diff --git a/core/modules/taxonomy/src/Access/TaxonomyOverviewAccessCheck.php b/core/modules/taxonomy/src/Access/TaxonomyOverviewAccessCheck.php index d529aa5..46833ca 100644 --- a/core/modules/taxonomy/src/Access/TaxonomyOverviewAccessCheck.php +++ b/core/modules/taxonomy/src/Access/TaxonomyOverviewAccessCheck.php @@ -2,7 +2,7 @@ /** * @file - * Contains \Drupal\taxonomy\Access\TaxonomyOverviewAccessCheck + * Contains \Drupal\taxonomy\Access\TaxonomyOverviewAccessCheck. */ namespace Drupal\taxonomy\Access; @@ -17,6 +17,8 @@ class TaxonomyOverviewAccessCheck implements AccessInterface { /** + * {@inheritdoc} + * * @param AccountInterface $account * @return AccessResult */ diff --git a/core/modules/taxonomy/src/Tests/VocabularyPermissionsTest.php b/core/modules/taxonomy/src/Tests/VocabularyPermissionsTest.php index 1c9f08f..0c5f2ad 100644 --- a/core/modules/taxonomy/src/Tests/VocabularyPermissionsTest.php +++ b/core/modules/taxonomy/src/Tests/VocabularyPermissionsTest.php @@ -24,7 +24,7 @@ protected function setUp() { * Create, edit and delete a vocabulary via the user interface. */ function testVocabularyPermissionsVocabulary() { - // VocabularyTest.php already tests for user with "administer taxonomy" permissions. + // VocabularyTest.php already tests for user with "administer taxonomy". // Test as user without proper permissions. $authenticated_user = $this->drupalCreateUser([]); diff --git a/core/modules/taxonomy/src/VocabularyListBuilder.php b/core/modules/taxonomy/src/VocabularyListBuilder.php index 5082a63..4988e94 100644 --- a/core/modules/taxonomy/src/VocabularyListBuilder.php +++ b/core/modules/taxonomy/src/VocabularyListBuilder.php @@ -50,10 +50,10 @@ class VocabularyListBuilder extends DraggableListBuilder { * The entity type definition. * @param \Drupal\Core\Entity\EntityStorageInterface $storage * The entity storage class. - * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager - * The entity manager service. * @param \Drupal\Core\Session\AccountInterface $current_user * The current user. + * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager + * The entity manager service. */ public function __construct(EntityTypeInterface $entity_type, EntityStorageInterface $storage, AccountInterface $current_user, EntityManagerInterface $entity_manager) { parent::__construct($entity_type, $storage); @@ -126,8 +126,11 @@ public function buildHeader() { * {@inheritdoc} */ public function buildRow(EntityInterface $entity) { - $row['label'] = $entity->label(); - return $row + parent::buildRow($entity); + $taxonomy_term_access_control_handler = $this->entityManager->getAccessControlHandler('taxonomy_term'); + if ($taxonomy_term_access_control_handler->createAccess($entity->id())) { + $row['label'] = $entity->label(); + return $row + parent::buildRow($entity); + } } /** diff --git a/core/modules/taxonomy/taxonomy.routing.yml b/core/modules/taxonomy/taxonomy.routing.yml index bd00f33..0ee60f6 100644 --- a/core/modules/taxonomy/taxonomy.routing.yml +++ b/core/modules/taxonomy/taxonomy.routing.yml @@ -72,7 +72,7 @@ entity.taxonomy_vocabulary.overview_form: _form: 'Drupal\taxonomy\Form\OverviewTerms' _title_callback: 'Drupal\taxonomy\Controller\TaxonomyController::vocabularyTitle' requirements: - _entity_access: 'taxonomy_vocabulary.view' + _access_taxonomy_overview: 'TRUE' entity.taxonomy_term.canonical: path: '/taxonomy/term/{taxonomy_term}'