You are here

function sbp_test_node_grants in Search by Page 6

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

Implementation of 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 110
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;
}