/**
  * Checks access given an account, configuration mapper, and source language.
  *
  * Grants access if the proper permission is granted to the account, the
  * configuration has translatable pieces, and the source language is not
  * locked given it is present.
  *
  * @param \Drupal\Core\Session\AccountInterface $account
  *   The account to check access for.
  * @param \Drupal\config_translation\ConfigMapperInterface $mapper
  *   The configuration mapper to check access for.
  * @param \Drupal\Core\Language\LanguageInterface|null $source_language
  *   The source language to check for, if any.
  *
  * @return \Drupal\Core\Access\AccessResultInterface
  *   The result of the access check.
  */
 protected function doCheckAccess(AccountInterface $account, ConfigMapperInterface $mapper, $source_language = NULL)
 {
     $access = $account->hasPermission('translate configuration') && $mapper->hasSchema() && $mapper->hasTranslatable() && (!$source_language || !$source_language->isLocked());
     return AccessResult::allowedIf($access)->cachePerPermissions();
 }