function FileResourceTestBase::getExpectedUnauthorizedAccessMessage

Same name in other branches
  1. 9 core/modules/file/tests/src/Functional/Rest/FileResourceTestBase.php \Drupal\Tests\file\Functional\Rest\FileResourceTestBase::getExpectedUnauthorizedAccessMessage()
  2. 8.9.x core/modules/file/tests/src/Functional/Rest/FileResourceTestBase.php \Drupal\Tests\file\Functional\Rest\FileResourceTestBase::getExpectedUnauthorizedAccessMessage()
  3. 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 220

Class

FileResourceTestBase

Namespace

Drupal\Tests\file\Functional\Rest

Code

protected function getExpectedUnauthorizedAccessMessage($method) {
    return match ($method) {    'GET' => "The 'access content' permission is required.",
        'PATCH' => "Only the file owner can update the file entity.",
        'DELETE' => "The 'delete any file' permission is required.",
        default => parent::getExpectedUnauthorizedAccessMessage($method),
    
    };
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.