You are here

function book_access_node_access_records in Book access 1.x

Same name and namespace in other branches
  1. 5 book_access.module \book_access_node_access_records()
  2. 6.2 book_access.module \book_access_node_access_records()
  3. 6 book_access.module \book_access_node_access_records()
  4. 7.2 book_access.module \book_access_node_access_records()

Implements hook_node_access_records().

Returns a list of grant records for the book node object passed as argument. If we have a book child page, we return the access settings of the top level parent book page node.

File

./book_access.module, line 389

Code

function book_access_node_access_records(NodeInterface $node) {

  /*  $grants = array();

    if (!empty($node->book['bid'])) {
    $grants = BookAccess::getGrantRecords($node->book['bid']);

    if (is_array($grants) && !$node->isPublished()) {
    // unpublished node, grant_view should be off for all types (author,role,user)
    foreach ($grants as &$grant) {
    $grant['grant_view'] = 0;
    }
    }
    }

    return $grants;*/
}