You are here

protected function FileUploadResourceTestBase::setUpAuthorization in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/rest/tests/src/Functional/FileUploadResourceTestBase.php \Drupal\Tests\rest\Functional\FileUploadResourceTestBase::setUpAuthorization()
  2. 9 core/modules/rest/tests/src/Functional/FileUploadResourceTestBase.php \Drupal\Tests\rest\Functional\FileUploadResourceTestBase::setUpAuthorization()

File

core/modules/rest/tests/src/Functional/FileUploadResourceTestBase.php, line 789

Class

FileUploadResourceTestBase
Tests binary data file upload route.

Namespace

Drupal\Tests\rest\Functional

Code

protected function setUpAuthorization($method) {
  switch ($method) {
    case 'GET':
      $this
        ->grantPermissionsToTestedRole([
        'view test entity',
      ]);
      break;
    case 'POST':
      $this
        ->grantPermissionsToTestedRole([
        'create entity_test entity_test_with_bundle entities',
        'access content',
      ]);
      break;
  }
}