function FileResourceTestBase::getExpectedUnauthorizedAccessMessage
Same name in other branches
- 9 core/modules/file/tests/src/Functional/Rest/FileResourceTestBase.php \Drupal\Tests\file\Functional\Rest\FileResourceTestBase::getExpectedUnauthorizedAccessMessage()
- 10 core/modules/file/tests/src/Functional/Rest/FileResourceTestBase.php \Drupal\Tests\file\Functional\Rest\FileResourceTestBase::getExpectedUnauthorizedAccessMessage()
- 11.x core/modules/file/tests/src/Functional/Rest/FileResourceTestBase.php \Drupal\Tests\file\Functional\Rest\FileResourceTestBase::getExpectedUnauthorizedAccessMessage()
Overrides EntityResourceTestBase::getExpectedUnauthorizedAccessMessage
File
-
core/
modules/ file/ tests/ src/ Functional/ Rest/ FileResourceTestBase.php, line 219
Class
Namespace
Drupal\Tests\file\Functional\RestCode
protected function getExpectedUnauthorizedAccessMessage($method) {
if ($this->config('rest.settings')
->get('bc_entity_resource_permissions')) {
if ($method === 'DELETE') {
return 'Only the file owner can update or delete the file entity.';
}
return parent::getExpectedUnauthorizedAccessMessage($method);
}
if ($method === 'GET') {
return "The 'access content' permission is required.";
}
if ($method === 'PATCH' || $method === 'DELETE') {
return 'Only the file owner can update or delete the file entity.';
}
return parent::getExpectedUnauthorizedAccessMessage($method);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.