You are here

protected function ShortcutResourceTestBase::setUpAuthorization in Drupal 10

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

File

core/modules/shortcut/tests/src/Functional/Rest/ShortcutResourceTestBase.php, line 39

Class

ShortcutResourceTestBase
ResourceTestBase for Shortcut entity.

Namespace

Drupal\Tests\shortcut\Functional\Rest

Code

protected function setUpAuthorization($method) {
  switch ($method) {
    case 'GET':
    case 'POST':
    case 'PATCH':
    case 'DELETE':
      $this
        ->grantPermissionsToTestedRole([
        'access shortcuts',
        'customize shortcut links',
      ]);
      break;
  }
}