function ContentTranslationTestBase::getTranslatePermission
Same name in this branch
- 8.9.x core/modules/content_translation/tests/src/Functional/ContentTranslationTestBase.php \Drupal\Tests\content_translation\Functional\ContentTranslationTestBase::getTranslatePermission()
Same name in other branches
- 9 core/modules/content_translation/tests/src/Functional/ContentTranslationTestBase.php \Drupal\Tests\content_translation\Functional\ContentTranslationTestBase::getTranslatePermission()
- 10 core/modules/content_translation/tests/src/Functional/ContentTranslationTestBase.php \Drupal\Tests\content_translation\Functional\ContentTranslationTestBase::getTranslatePermission()
- 11.x core/modules/content_translation/tests/src/Functional/ContentTranslationTestBase.php \Drupal\Tests\content_translation\Functional\ContentTranslationTestBase::getTranslatePermission()
Returns the translate permissions for the current entity and bundle.
1 call to ContentTranslationTestBase::getTranslatePermission()
- ContentTranslationTestBase::getTranslatorPermissions in core/
modules/ content_translation/ src/ Tests/ ContentTranslationTestBase.php - Returns an array of permissions needed for the translator.
File
-
core/
modules/ content_translation/ src/ Tests/ ContentTranslationTestBase.php, line 129
Class
- ContentTranslationTestBase
- Base class for content translation tests.
Namespace
Drupal\content_translation\TestsCode
protected function getTranslatePermission() {
$entity_type = \Drupal::entityTypeManager()->getDefinition($this->entityTypeId);
if ($permission_granularity = $entity_type->getPermissionGranularity()) {
return $permission_granularity == 'bundle' ? "translate {$this->bundle} {$this->entityTypeId}" : "translate {$this->entityTypeId}";
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.