function ResourceTestBase::grantPermissionsToAuthenticatedRole
Same name in other branches
- 8.9.x core/modules/rest/tests/src/Functional/ResourceTestBase.php \Drupal\Tests\rest\Functional\ResourceTestBase::grantPermissionsToAuthenticatedRole()
- 10 core/modules/rest/tests/src/Functional/ResourceTestBase.php \Drupal\Tests\rest\Functional\ResourceTestBase::grantPermissionsToAuthenticatedRole()
- 11.x core/modules/rest/tests/src/Functional/ResourceTestBase.php \Drupal\Tests\rest\Functional\ResourceTestBase::grantPermissionsToAuthenticatedRole()
Grants permissions to the authenticated role.
Parameters
string[] $permissions: Permissions to grant.
3 calls to ResourceTestBase::grantPermissionsToAuthenticatedRole()
- ResourceTestBase::grantPermissionsToTestedRole in core/
modules/ rest/ tests/ src/ Functional/ ResourceTestBase.php - Grants permissions to the tested role: anonymous or authenticated.
- RestRegisterUserTest::setUpAuthorization in core/
modules/ hal/ tests/ src/ Functional/ user/ RestRegisterUserTest.php - Sets up the necessary authorization.
- UserRegistrationRestTest::setUpAuthorization in core/
modules/ user/ tests/ src/ Functional/ UserRegistrationRestTest.php - Sets up the necessary authorization.
File
-
core/
modules/ rest/ tests/ src/ Functional/ ResourceTestBase.php, line 304
Class
- ResourceTestBase
- Subclass this for every REST resource, every format and every auth provider.
Namespace
Drupal\Tests\rest\FunctionalCode
protected function grantPermissionsToAuthenticatedRole(array $permissions) {
$this->grantPermissions(Role::load(RoleInterface::AUTHENTICATED_ID), $permissions);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.