function BlockResourceTestBase::setUpAuthorization
Same name in other branches
- 9 core/modules/block/tests/src/Functional/Rest/BlockResourceTestBase.php \Drupal\Tests\block\Functional\Rest\BlockResourceTestBase::setUpAuthorization()
- 10 core/modules/block/tests/src/Functional/Rest/BlockResourceTestBase.php \Drupal\Tests\block\Functional\Rest\BlockResourceTestBase::setUpAuthorization()
- 11.x core/modules/block/tests/src/Functional/Rest/BlockResourceTestBase.php \Drupal\Tests\block\Functional\Rest\BlockResourceTestBase::setUpAuthorization()
Overrides ResourceTestBase::setUpAuthorization
File
-
core/
modules/ block/ tests/ src/ Functional/ Rest/ BlockResourceTestBase.php, line 29
Class
Namespace
Drupal\Tests\block\Functional\RestCode
protected function setUpAuthorization($method) {
switch ($method) {
case 'GET':
$this->entity
->setVisibilityConfig('user_role', [])
->save();
break;
case 'POST':
$this->grantPermissionsToTestedRole([
'administer blocks',
]);
break;
case 'PATCH':
$this->grantPermissionsToTestedRole([
'administer blocks',
]);
break;
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.