protected function BlockResourceTestBase::setUpAuthorization in Drupal 10
Same name and namespace in other branches
- 8 core/modules/block/tests/src/Functional/Rest/BlockResourceTestBase.php \Drupal\Tests\block\Functional\Rest\BlockResourceTestBase::setUpAuthorization()
- 9 core/modules/block/tests/src/Functional/Rest/BlockResourceTestBase.php \Drupal\Tests\block\Functional\Rest\BlockResourceTestBase::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;
}
}