protected function EntityTranslationTestBase::getTranslatePermission

Returns the translate permissions for the current entity and bundle.

2 calls to EntityTranslationTestBase::getTranslatePermission()
EntityTranslationTestBase::getTranslatorPermissions in drupal/core/modules/translation_entity/lib/Drupal/translation_entity/Tests/EntityTranslationTestBase.php
Returns an array of permissions needed for the translator.
EntityTranslationWorkflowsTest::testWorkflows in drupal/core/modules/translation_entity/lib/Drupal/translation_entity/Tests/EntityTranslationWorkflowsTest.php
Test simple and editorial translation workflows.

File

drupal/core/modules/translation_entity/lib/Drupal/translation_entity/Tests/EntityTranslationTestBase.php, line 112
Contains \Drupal\entity\Tests\EntityTranslationTestBase.

Class

EntityTranslationTestBase
Tests entity translation workflows.

Namespace

Drupal\translation_entity\Tests

Code

protected function getTranslatePermission() {
  $info = entity_get_info($this->entityType);
  if (!empty($info['permission_granularity'])) {
    return $info['permission_granularity'] == 'bundle' ? "translate {$this->bundle} {$this->entityType}" : "translate {$this->entityType}";
  }
}