function SearchPageResourceTestBase::setUpAuthorization

Same name in other branches
  1. 9 core/modules/search/tests/src/Functional/Rest/SearchPageResourceTestBase.php \Drupal\Tests\search\Functional\Rest\SearchPageResourceTestBase::setUpAuthorization()
  2. 10 core/modules/search/tests/src/Functional/Rest/SearchPageResourceTestBase.php \Drupal\Tests\search\Functional\Rest\SearchPageResourceTestBase::setUpAuthorization()
  3. 11.x core/modules/search/tests/src/Functional/Rest/SearchPageResourceTestBase.php \Drupal\Tests\search\Functional\Rest\SearchPageResourceTestBase::setUpAuthorization()

Overrides ResourceTestBase::setUpAuthorization

File

core/modules/search/tests/src/Functional/Rest/SearchPageResourceTestBase.php, line 28

Class

SearchPageResourceTestBase

Namespace

Drupal\Tests\search\Functional\Rest

Code

protected function setUpAuthorization($method) {
    switch ($method) {
        case 'GET':
            $this->grantPermissionsToTestedRole([
                'access content',
            ]);
            break;
        case 'POST':
        case 'PATCH':
        case 'DELETE':
            $this->grantPermissionsToTestedRole([
                'administer search',
            ]);
            break;
    }
}

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