Commit 78f93fae authored by alexpott's avatar alexpott

Issue #1810320 by alarcombe: Remove...

Issue #1810320 by alarcombe: Remove EntityTranslationControllerInterface::getAccess() once have entity access.
parent 08f15f24
......@@ -15,13 +15,6 @@
*/
class CustomBlockTranslationController extends ContentTranslationControllerNG {
/**
* Overrides ContentTranslationController::getAccess().
*/
public function getAccess(EntityInterface $entity, $op) {
return user_access('administer blocks');
}
/**
* Overrides ContentTranslationController::entityFormAlter().
*/
......
......@@ -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);
}
......
......@@ -90,13 +90,6 @@ public function getViewPath(EntityInterface $entity) {
return isset($this->entityInfo['menu_view_path']) ? $this->getPathInstance($this->entityInfo['menu_view_path'], $entity->id()) : FALSE;
}
/**
* Implements ContentTranslationControllerInterface::getAccess().
*/
public function getAccess(EntityInterface $entity, $op) {
return TRUE;
}
/**
* Implements ContentTranslationControllerInterface::getTranslationAccess().
*/
......
......@@ -111,24 +111,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.
......
......@@ -14,13 +14,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().
*/
......
......@@ -15,13 +15,6 @@
*/
class NodeTranslationController extends ContentTranslationController {
/**
* Overrides ContentTranslationController::getAccess().
*/
public function getAccess(EntityInterface $entity, $op) {
return node_access($op, $entity);
}
/**
* Overrides ContentTranslationController::entityFormAlter().
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment