You are here

protected function LanguageBlock::blockAccess in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/language/src/Plugin/Block/LanguageBlock.php \Drupal\language\Plugin\Block\LanguageBlock::blockAccess()
  2. 9 core/modules/language/src/Plugin/Block/LanguageBlock.php \Drupal\language\Plugin\Block\LanguageBlock::blockAccess()

File

core/modules/language/src/Plugin/Block/LanguageBlock.php, line 76

Class

LanguageBlock
Provides a 'Language switcher' block.

Namespace

Drupal\language\Plugin\Block

Code

protected function blockAccess(AccountInterface $account) {
  $access = $this->languageManager
    ->isMultilingual() ? AccessResult::allowed() : AccessResult::forbidden();
  return $access
    ->addCacheTags([
    'config:configurable_language_list',
  ]);
}