You are here

public function SearchByPageTesterTest::serch_by_page_test_node_grants in Search by Page 8

Implements hook_node_grants().

Sets up node access for testing purposes. If a node is marked "test_private", it is only available to users with 'view test private content' permissions. Code taken form the Node Access Example module on drupal.org.

File

tests/src/Functional/SearchByPageTesterTest.php, line 252
General Functional Tests for the Search by Page module. By Jennifer Hodgdon of Poplar ProductivityWare, www.poplarware.com

Class

SearchByPageTesterTest
Base class for testing Search by Page.

Namespace

Drupal\Tests\search_by_page\Functional

Code

public function serch_by_page_test_node_grants($account, $op) {
  $grants = array();
  if ($op == 'view' && user_access('view test private content', $account)) {
    $grants['search_by_page_test'] = array(
      888,
    );
  }
  return $grants;
}