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 a8848c7..2376422 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 EntityTranslationControllerNG { /** - * Overrides EntityTranslationController::getAccess(). - */ - public function getAccess(EntityInterface $entity, $op) { - return user_access('administer blocks'); - } - - /** * Overrides EntityTranslationController::entityFormAlter(). */ public function entityFormAlter(array &$form, array &$form_state, EntityInterface $entity) { diff --git a/core/modules/node/lib/Drupal/node/NodeTranslationController.php b/core/modules/node/lib/Drupal/node/NodeTranslationController.php index 4531a8e..5e8458d 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 EntityTranslationController { /** - * Overrides EntityTranslationController::getAccess(). - */ - public function getAccess(EntityInterface $entity, $op) { - return node_access($op, $entity); - } - - /** * Overrides EntityTranslationController::entityFormAlter(). */ public function entityFormAlter(array &$form, array &$form_state, EntityInterface $entity) { diff --git a/core/modules/translation_entity/lib/Drupal/translation_entity/EntityTranslationController.php b/core/modules/translation_entity/lib/Drupal/translation_entity/EntityTranslationController.php index 1fb68e5..dc66107 100644 --- a/core/modules/translation_entity/lib/Drupal/translation_entity/EntityTranslationController.php +++ b/core/modules/translation_entity/lib/Drupal/translation_entity/EntityTranslationController.php @@ -91,13 +91,6 @@ public function getViewPath(EntityInterface $entity) { } /** - * Implements EntityTranslationControllerInterface::getAccess(). - */ - public function getAccess(EntityInterface $entity, $op) { - return TRUE; - } - - /** * Implements EntityTranslationControllerInterface::getTranslationAccess(). */ public function getTranslationAccess(EntityInterface $entity, $op) { diff --git a/core/modules/translation_entity/lib/Drupal/translation_entity/EntityTranslationControllerInterface.php b/core/modules/translation_entity/lib/Drupal/translation_entity/EntityTranslationControllerInterface.php index dbac33b..c6e323a 100644 --- a/core/modules/translation_entity/lib/Drupal/translation_entity/EntityTranslationControllerInterface.php +++ b/core/modules/translation_entity/lib/Drupal/translation_entity/EntityTranslationControllerInterface.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/translation_entity/lib/Drupal/translation_entity/EntityTranslationControllerNG.php b/core/modules/translation_entity/lib/Drupal/translation_entity/EntityTranslationControllerNG.php index fd007cd..2aa447b 100644 --- a/core/modules/translation_entity/lib/Drupal/translation_entity/EntityTranslationControllerNG.php +++ b/core/modules/translation_entity/lib/Drupal/translation_entity/EntityTranslationControllerNG.php @@ -15,13 +15,6 @@ class EntityTranslationControllerNG extends EntityTranslationController { /** - * Overrides \Drupal\translation_entity\EntityTranslationController::getAccess(). - */ - public function getAccess(EntityInterface $entity, $op) { - return $entity->access($op); - } - - /** * Overrides \Drupal\translation_entity\EntityTranslationControllerInterface::removeTranslation(). */ public function removeTranslation(EntityInterface $entity, $langcode) { diff --git a/core/modules/translation_entity/translation_entity.pages.inc b/core/modules/translation_entity/translation_entity.pages.inc index cd212eb..d9746a2 100644 --- a/core/modules/translation_entity/translation_entity.pages.inc +++ b/core/modules/translation_entity/translation_entity.pages.inc @@ -86,7 +86,7 @@ function translation_entity_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 translation_entity_add_page(EntityInterface $entity, Language $source = $form_state['translation_entity']['source'] = $source; $form_state['translation_entity']['target'] = $target; $controller = translation_entity_controller($entity->entityType()); - $form_state['translation_entity']['translation_form'] = !$controller->getAccess($entity, 'update'); + $form_state['translation_entity']['translation_form'] = !$entity->access('update'); return Drupal::entityManager()->getForm($entity, $operation, $form_state); }