3 namespace Drupal\taxonomy;
5 use Drupal\Core\Access\AccessResult;
6 use Drupal\Core\Entity\EntityAccessControlHandler;
7 use Drupal\Core\Entity\EntityInterface;
8 use Drupal\Core\Session\AccountInterface;
11 * Defines the access control handler for the taxonomy vocabulary entity type.
13 * @see \Drupal\taxonomy\Entity\Vocabulary
15 class VocabularyAccessControlHandler extends EntityAccessControlHandler {
20 protected function checkAccess(EntityInterface $entity, $operation, AccountInterface $account) {
22 case 'access taxonomy overview':
24 return AccessResult::allowedIfHasPermissions($account, ['access taxonomy overview', 'administer taxonomy'], 'OR');
27 return parent::checkAccess($entity, $operation, $account);