You are here

protected function ResourceTestBase::grantPermissionsToTestedRole in Drupal 10

Same name in this branch
  1. 10 core/modules/jsonapi/tests/src/Functional/ResourceTestBase.php \Drupal\Tests\jsonapi\Functional\ResourceTestBase::grantPermissionsToTestedRole()
  2. 10 core/modules/rest/tests/src/Functional/ResourceTestBase.php \Drupal\Tests\rest\Functional\ResourceTestBase::grantPermissionsToTestedRole()
Same name and namespace in other branches
  1. 8 core/modules/jsonapi/tests/src/Functional/ResourceTestBase.php \Drupal\Tests\jsonapi\Functional\ResourceTestBase::grantPermissionsToTestedRole()
  2. 9 core/modules/jsonapi/tests/src/Functional/ResourceTestBase.php \Drupal\Tests\jsonapi\Functional\ResourceTestBase::grantPermissionsToTestedRole()

Grants permissions to the authenticated role.

Parameters

string[] $permissions: Permissions to grant.

File

core/modules/jsonapi/tests/src/Functional/ResourceTestBase.php, line 665

Class

ResourceTestBase
Subclass this for every JSON:API resource type.

Namespace

Drupal\Tests\jsonapi\Functional

Code

protected function grantPermissionsToTestedRole(array $permissions) {
  $this
    ->grantPermissions(Role::load(RoleInterface::AUTHENTICATED_ID), $permissions);
}