Loading src/Form/ContentExportForm.php +11 −1 Original line number Diff line number Diff line Loading @@ -3,6 +3,7 @@ namespace Drupal\single_content_sync\Form; use Drupal\Core\Access\AccessResult; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Form\FormBase; use Drupal\Core\Form\FormStateInterface; Loading Loading @@ -241,11 +242,20 @@ class ContentExportForm extends FormBase { } /** * {@inheritdoc} * Check if user has access to the export form. */ public function access() { $parameters = $this->getRouteMatch()->getParameters(); $entity = $parameters->getIterator()->current(); if (is_string($entity)) { $entity = $parameters->get($entity); } if (!$entity instanceof EntityInterface) { return AccessResult::forbidden(); } $hasAccess = $this->contentSyncHelper->access($entity); return $hasAccess ? AccessResult::allowed() : AccessResult::forbidden(); Loading Loading
src/Form/ContentExportForm.php +11 −1 Original line number Diff line number Diff line Loading @@ -3,6 +3,7 @@ namespace Drupal\single_content_sync\Form; use Drupal\Core\Access\AccessResult; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Form\FormBase; use Drupal\Core\Form\FormStateInterface; Loading Loading @@ -241,11 +242,20 @@ class ContentExportForm extends FormBase { } /** * {@inheritdoc} * Check if user has access to the export form. */ public function access() { $parameters = $this->getRouteMatch()->getParameters(); $entity = $parameters->getIterator()->current(); if (is_string($entity)) { $entity = $parameters->get($entity); } if (!$entity instanceof EntityInterface) { return AccessResult::forbidden(); } $hasAccess = $this->contentSyncHelper->access($entity); return $hasAccess ? AccessResult::allowed() : AccessResult::forbidden(); Loading