function ContactFormResourceTestBase::setUpAuthorization

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

Overrides ResourceTestBase::setUpAuthorization

File

core/modules/contact/tests/src/Functional/Rest/ContactFormResourceTestBase.php, line 36

Class

ContactFormResourceTestBase

Namespace

Drupal\Tests\contact\Functional\Rest

Code

protected function setUpAuthorization($method) {
    switch ($method) {
        case 'GET':
            $this->grantPermissionsToTestedRole([
                'access site-wide contact form',
            ]);
        default:
            $this->grantPermissionsToTestedRole([
                'administer contact forms',
            ]);
    }
}

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