diff --git a/core/modules/content_translation/content_translation.api.php b/core/modules/content_translation/content_translation.api.php index 8d882c7ace..abfe1f093c 100644 --- a/core/modules/content_translation/content_translation.api.php +++ b/core/modules/content_translation/content_translation.api.php @@ -17,6 +17,8 @@ * * @param \Drupal\Core\Entity\EntityInterface $entity * The entity to check access to. + * @param string $operation + * The operation that is to be performed on $entity. * @param \Drupal\Core\Session\AccountInterface $account * The account trying to access the entity. * @@ -31,7 +33,7 @@ * * @ingroup content_translation */ -function hook_entity_translation_access(\Drupal\Core\Entity\EntityInterface $entity, \Drupal\Core\Session\AccountInterface $account) { +function hook_entity_translation_access(\Drupal\Core\Entity\EntityInterface $entity, $operation, \Drupal\Core\Session\AccountInterface $account) { // No opinion. return AccessResult::neutral(); } diff --git a/core/modules/content_translation/src/ContentTranslationHandler.php b/core/modules/content_translation/src/ContentTranslationHandler.php index ad20c47dd9..9cec88cf33 100644 --- a/core/modules/content_translation/src/ContentTranslationHandler.php +++ b/core/modules/content_translation/src/ContentTranslationHandler.php @@ -255,7 +255,7 @@ public function getTranslationAccess(EntityInterface $entity, $op) { $result = AccessResult::allowedIf($translate_permission && $this->currentUser->hasPermission("$op content translations"))->cachePerPermissions(); - $access = \Drupal::moduleHandler()->invokeAll('entity_translation_access', [$entity, $this->currentUser]); + $access = \Drupal::moduleHandler()->invokeAll('entity_translation_access', [$entity, $op, $this->currentUser]); foreach ($access as $other) { $result->orIf($other);