function SearchCommentTest::setRolePermissions

Same name in other branches
  1. 9 core/modules/search/tests/src/Functional/SearchCommentTest.php \Drupal\Tests\search\Functional\SearchCommentTest::setRolePermissions()
  2. 8.9.x core/modules/search/tests/src/Functional/SearchCommentTest.php \Drupal\Tests\search\Functional\SearchCommentTest::setRolePermissions()
  3. 11.x core/modules/search/tests/src/Functional/SearchCommentTest.php \Drupal\Tests\search\Functional\SearchCommentTest::setRolePermissions()

Set permissions for role.

1 call to SearchCommentTest::setRolePermissions()
SearchCommentTest::testSearchResultsCommentAccess in core/modules/search/tests/src/Functional/SearchCommentTest.php
Verify access rules for comment indexing with different permissions.

File

core/modules/search/tests/src/Functional/SearchCommentTest.php, line 305

Class

SearchCommentTest
Tests integration searching comments.

Namespace

Drupal\Tests\search\Functional

Code

public function setRolePermissions($rid, $access_comments = FALSE, $search_content = TRUE) {
    $permissions = [
        'access comments' => $access_comments,
        'search content' => $search_content,
    ];
    user_role_change_permissions($rid, $permissions);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.