function SearchCommentTest::setRolePermissions

Same name and namespace in other branches
  1. 8.9.x core/modules/search/tests/src/Functional/SearchCommentTest.php \Drupal\Tests\search\Functional\SearchCommentTest::setRolePermissions()
  2. 10 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 303

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.