protected function TranslatorAccessControlHandler::checkCreateAccess

File

src/Entity/Controller/TranslatorAccessControlHandler.php, line 67

Class

TranslatorAccessControlHandler
Access control handler for the translator entity.

Namespace

Drupal\tmgmt\Entity\Controller

Code

protected function checkCreateAccess(AccountInterface $account, array $context, $entity_bundle = NULL) {
  $installed_translators = $this->translatorManager
    ->getLabels();
  if (empty($installed_translators)) {
    return AccessResult::forbidden();
  }
  return AccessResult::allowedIfHasPermission($account, 'administer tmgmt');
}