summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2013-06-28 09:31:01 +0100
committerAlex Pott2013-06-28 09:31:01 +0100
commit78f93faef31786aa5ba5b70e32a8309ac2abf2f9 (patch)
tree1fe0178d4ad9dd0b7f03b97616eb5470adad03b5
parent08f15f248754e22bfc48938db2ea1c1adb55f35b (diff)
Issue #1810320 by alarcombe: Remove EntityTranslationControllerInterface::getAccess() once have entity access.
-rw-r--r--core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockTranslationController.php7
-rw-r--r--core/modules/content_translation/content_translation.pages.inc4
-rw-r--r--core/modules/content_translation/lib/Drupal/content_translation/ContentTranslationController.php7
-rw-r--r--core/modules/content_translation/lib/Drupal/content_translation/ContentTranslationControllerInterface.php18
-rw-r--r--core/modules/content_translation/lib/Drupal/content_translation/ContentTranslationControllerNG.php7
-rw-r--r--core/modules/node/lib/Drupal/node/NodeTranslationController.php7
6 files changed, 2 insertions, 48 deletions
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 @@ use Drupal\content_translation\ContentTranslationControllerNG;
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 f7120e2..5bc9501 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 1572186..5e4ad79 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 @@ class ContentTranslationController implements ContentTranslationControllerInterf
}
/**
- * 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 @@ interface ContentTranslationControllerInterface {
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 @@ use Drupal\Core\Entity\EntityInterface;
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 @@ use Drupal\content_translation\ContentTranslationController;
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) {