diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockTranslationController.php b/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockTranslationController.php index 851ac69..4436f57 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockTranslationController.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockTranslationController.php @@ -16,13 +16,6 @@ class CustomBlockTranslationController extends ContentTranslationControllerNG { /** - * Overrides ContentTranslationController::getAccess(). - */ - public function getAccess(EntityInterface $entity, $op) { - return user_access('administer blocks'); - } - - /** * Overrides ContentTranslationController::entityFormAlter(). */ public function entityFormAlter(array &$form, array &$form_state, EntityInterface $entity) { diff --git a/core/modules/content_translation/content_translation.pages.inc b/core/modules/content_translation/content_translation.pages.inc index 2940585..0cc487e 100644 --- a/core/modules/content_translation/content_translation.pages.inc +++ b/core/modules/content_translation/content_translation.pages.inc @@ -86,7 +86,7 @@ function content_translation_overview(EntityInterface $entity) { // If the user is allowed to edit the entity we point the edit link to // the entity form, otherwise if we are not dealing with the original // language we point the link to the translation form. - if ($edit_path && $controller->getAccess($entity, 'update')) { + if ($edit_path && $entity->access('update')) { $links['edit'] = isset($edit_links->links[$langcode]['href']) ? $edit_links->links[$langcode] : array('href' => $edit_path, 'language' => $language); } elseif (!$is_original && $controller->getTranslationAccess($entity, 'update')) { @@ -201,7 +201,7 @@ function content_translation_add_page(EntityInterface $entity, Language $source $form_state['content_translation']['source'] = $source; $form_state['content_translation']['target'] = $target; $controller = content_translation_controller($entity->entityType()); - $form_state['content_translation']['translation_form'] = !$controller->getAccess($entity, 'update'); + $form_state['content_translation']['translation_form'] = !$entity->access('update'); return Drupal::entityManager()->getForm($entity, $operation, $form_state); } diff --git a/core/modules/content_translation/lib/Drupal/content_translation/ContentTranslationController.php b/core/modules/content_translation/lib/Drupal/content_translation/ContentTranslationController.php index 944ec69..a0afda2 100644 --- a/core/modules/content_translation/lib/Drupal/content_translation/ContentTranslationController.php +++ b/core/modules/content_translation/lib/Drupal/content_translation/ContentTranslationController.php @@ -91,13 +91,6 @@ public function getViewPath(EntityInterface $entity) { } /** - * Implements ContentTranslationControllerInterface::getAccess(). - */ - public function getAccess(EntityInterface $entity, $op) { - return TRUE; - } - - /** * Implements ContentTranslationControllerInterface::getTranslationAccess(). */ public function getTranslationAccess(EntityInterface $entity, $op) { diff --git a/core/modules/content_translation/lib/Drupal/content_translation/ContentTranslationControllerInterface.php b/core/modules/content_translation/lib/Drupal/content_translation/ContentTranslationControllerInterface.php index 112d8e8..b28dd8d 100644 --- a/core/modules/content_translation/lib/Drupal/content_translation/ContentTranslationControllerInterface.php +++ b/core/modules/content_translation/lib/Drupal/content_translation/ContentTranslationControllerInterface.php @@ -112,24 +112,6 @@ public function getEditPath(EntityInterface $entity); public function getViewPath(EntityInterface $entity); /** - * Checks if the user can perform the given operation on the wrapped entity. - * - * @param \Drupal\Core\Entity\EntityInterface $entity - * The entity access should be checked for. - * @param string $op - * The operation to be performed. Possible values are: - * - "view" - * - "update" - * - "delete" - * - "create" - * - * @return - * TRUE if the user is allowed to perform the given operation, FALSE - * otherwise. - */ - public function getAccess(EntityInterface $entity, $op); - - /** * Checks if the user can perform the given operation on translations of the * wrapped entity. * diff --git a/core/modules/content_translation/lib/Drupal/content_translation/ContentTranslationControllerNG.php b/core/modules/content_translation/lib/Drupal/content_translation/ContentTranslationControllerNG.php index 6c27d49..6f7f4f0 100644 --- a/core/modules/content_translation/lib/Drupal/content_translation/ContentTranslationControllerNG.php +++ b/core/modules/content_translation/lib/Drupal/content_translation/ContentTranslationControllerNG.php @@ -15,13 +15,6 @@ class ContentTranslationControllerNG extends ContentTranslationController { /** - * Overrides \Drupal\content_translation\ContentTranslationController::getAccess(). - */ - public function getAccess(EntityInterface $entity, $op) { - return $entity->access($op); - } - - /** * Overrides \Drupal\content_translation\ContentTranslationControllerInterface::removeTranslation(). */ public function removeTranslation(EntityInterface $entity, $langcode) { diff --git a/core/modules/node/lib/Drupal/node/NodeTranslationController.php b/core/modules/node/lib/Drupal/node/NodeTranslationController.php index 1109724..ac063a0 100644 --- a/core/modules/node/lib/Drupal/node/NodeTranslationController.php +++ b/core/modules/node/lib/Drupal/node/NodeTranslationController.php @@ -16,13 +16,6 @@ class NodeTranslationController extends ContentTranslationController { /** - * Overrides ContentTranslationController::getAccess(). - */ - public function getAccess(EntityInterface $entity, $op) { - return node_access($op, $entity); - } - - /** * Overrides ContentTranslationController::entityFormAlter(). */ public function entityFormAlter(array &$form, array &$form_state, EntityInterface $entity) {