summaryrefslogtreecommitdiffstats
path: root/core/modules/rest/src/Plugin/rest/resource/EntityResource.php
diff options
context:
space:
mode:
authorAlex Pott2016-08-01 17:35:08 +0100
committerAlex Pott2016-08-01 17:35:08 +0100
commit23ed767a23b96415d73d164e6ceea43a90374eed (patch)
treedfe1da9d0fe68b066bae21d6130c209cd398aaf8 /core/modules/rest/src/Plugin/rest/resource/EntityResource.php
parent85d755a992d89ac101580a9d3fa692b2b3ed7112 (diff)
Revert "Issue #2664780 by Wim Leers, tedbow, dawehner, klausi: Remove REST's resource- and verb-specific permissions for EntityResource, but provide BC and document why it's necessary for other resources"
This reverts commit 85d755a992d89ac101580a9d3fa692b2b3ed7112.
Diffstat (limited to 'core/modules/rest/src/Plugin/rest/resource/EntityResource.php')
-rw-r--r--core/modules/rest/src/Plugin/rest/resource/EntityResource.php31
1 files changed, 2 insertions, 29 deletions
diff --git a/core/modules/rest/src/Plugin/rest/resource/EntityResource.php b/core/modules/rest/src/Plugin/rest/resource/EntityResource.php
index 5cf42dd..8b96940 100644
--- a/core/modules/rest/src/Plugin/rest/resource/EntityResource.php
+++ b/core/modules/rest/src/Plugin/rest/resource/EntityResource.php
@@ -6,7 +6,6 @@ use Drupal\Component\Plugin\DependentPluginInterface;
use Drupal\Core\Config\Entity\ConfigEntityType;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Entity\FieldableEntityInterface;
-use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityStorageException;
use Drupal\rest\Plugin\ResourceBase;
@@ -44,13 +43,6 @@ class EntityResource extends ResourceBase implements DependentPluginInterface {
protected $entityType;
/**
- * The config factory.
- *
- * @var \Drupal\Core\Config\ConfigFactoryInterface
- */
- protected $configFactory;
-
- /**
* Constructs a Drupal\rest\Plugin\rest\resource\EntityResource object.
*
* @param array $configuration
@@ -65,13 +57,10 @@ class EntityResource extends ResourceBase implements DependentPluginInterface {
* The available serialization formats.
* @param \Psr\Log\LoggerInterface $logger
* A logger instance.
- * @param \Drupal\Core\Config\ConfigFactoryInterface
- * The config factory.
*/
- public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityTypeManagerInterface $entity_type_manager, $serializer_formats, LoggerInterface $logger, ConfigFactoryInterface $config_factory) {
+ public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityTypeManagerInterface $entity_type_manager, $serializer_formats, LoggerInterface $logger) {
parent::__construct($configuration, $plugin_id, $plugin_definition, $serializer_formats, $logger);
$this->entityType = $entity_type_manager->getDefinition($plugin_definition['entity_type']);
- $this->configFactory = $config_factory;
}
/**
@@ -84,8 +73,7 @@ class EntityResource extends ResourceBase implements DependentPluginInterface {
$plugin_definition,
$container->get('entity_type.manager'),
$container->getParameter('serializer.formats'),
- $container->get('logger.factory')->get('rest'),
- $container->get('config.factory')
+ $container->get('logger.factory')->get('rest')
);
}
@@ -312,21 +300,6 @@ class EntityResource extends ResourceBase implements DependentPluginInterface {
/**
* {@inheritdoc}
*/
- public function permissions() {
- // @see https://www.drupal.org/node/2664780
- if ($this->configFactory->get('rest.settings')->get('bc_entity_resource_permissions')) {
- // The default Drupal 8.0.x and 8.1.x behavior.
- return parent::permissions();
- }
- else {
- // The default Drupal 8.2.x behavior.
- return [];
- }
- }
-
- /**
- * {@inheritdoc}
- */
protected function getBaseRoute($canonical_path, $method) {
$route = parent::getBaseRoute($canonical_path, $method);
$definition = $this->getPluginDefinition();