You are here

private function TranslationOperationsFieldPermissionsTest::addPermissionsForAuthUser in Translation Views 8

Add specific set of permissions to the "authenticated" role.

Parameters

array $permissions: Permissions array.

3 calls to TranslationOperationsFieldPermissionsTest::addPermissionsForAuthUser()
TranslationOperationsFieldPermissionsTest::testTranslationOperationsCreatePermissions in tests/src/Functional/TranslationOperationsFieldPermissionsTest.php
Test translation operation create permissions.
TranslationOperationsFieldPermissionsTest::testTranslationOperationsDeletePermissions in tests/src/Functional/TranslationOperationsFieldPermissionsTest.php
Test translation operation delete permissions.
TranslationOperationsFieldPermissionsTest::testTranslationOperationsUpdatePermissions in tests/src/Functional/TranslationOperationsFieldPermissionsTest.php
Test translation operation update permissions.

File

tests/src/Functional/TranslationOperationsFieldPermissionsTest.php, line 121

Class

TranslationOperationsFieldPermissionsTest
Class TranslationOperationsFieldPermissionsTest.

Namespace

Drupal\Tests\translation_views\Functional

Code

private function addPermissionsForAuthUser(array $permissions = []) {
  if (!empty($permissions)) {
    $role = Role::load(Role::AUTHENTICATED_ID);
    if ($role instanceof Role) {
      $this
        ->grantPermissions($role, $permissions);
    }
  }
}