You are here

function sbp_test_node_grants in Search by Page 7

Same name and namespace in other branches
  1. 6 tests/sbp_test.module \sbp_test_node_grants()

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/sbp_test.module, line 92
Module file for Search by Page testing.

Code

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