reverted: --- b/core/modules/rest/lib/Drupal/rest/FileAccessController.php +++ /dev/null @@ -1,33 +0,0 @@ -getFileUri()) == 'public')) { - return TRUE; - } - else { - return parent::checkAccess($entity, $operation, $langcode, $account); - } - } - -} diff -u b/core/modules/rest/lib/Drupal/rest/Tests/FileTest.php b/core/modules/rest/lib/Drupal/rest/Tests/FileTest.php --- b/core/modules/rest/lib/Drupal/rest/Tests/FileTest.php +++ b/core/modules/rest/lib/Drupal/rest/Tests/FileTest.php @@ -7,8 +7,6 @@ namespace Drupal\rest\Tests; -use Drupal\rest\Tests\RESTTestBase; - /** * Tests resource read operations on files. */ @@ -21,6 +19,9 @@ */ public static $modules = array('rest', 'hal', 'file'); + /** + * {@inheritdoc} + */ public static function getInfo() { return array( 'name' => 'File resource', @@ -50,6 +51,7 @@ */ public function testFiles() { $this->enableFileConfiguration('GET', 'view'); + /** @var \Drupal\file\FileInterface $file */ $file = $this->entityCreate('file'); $file->setFileUri('public://'); $file->save(); reverted: --- b/core/modules/rest/rest.module +++ a/core/modules/rest/rest.module @@ -34,14 +34,3 @@ return $output; } } - -/** - * Implements hook_entity_info_alter(). - */ -function rest_entity_info_alter(&$entity_info) { - if (isset($entity_info['file'])) { - $controllers = $entity_info['file']->get('controllers'); - $controllers['access'] = 'Drupal\\rest\\FileAccessController'; - $entity_info['file']->set('controllers', $controllers); - } -} only in patch2: unchanged: --- a/core/modules/file/lib/Drupal/file/Entity/File.php +++ b/core/modules/file/lib/Drupal/file/Entity/File.php @@ -21,6 +21,7 @@ * id = "file", * label = @Translation("File"), * controllers = { + * "access" = "Drupal\file\FileAccessController", * "storage" = "Drupal\file\FileStorageController", * "view_builder" = "Drupal\Core\Entity\EntityViewBuilder" * }, only in patch2: unchanged: --- /dev/null +++ b/core/modules/file/lib/Drupal/file/FileAccessController.php @@ -0,0 +1,34 @@ +getFileUri()) == 'public')) { + return TRUE; + } + else { + return parent::checkAccess($entity, $operation, $langcode, $account); + } + } + +}