You are here

function book_access_node_access_records in Book access 6.2

Same name and namespace in other branches
  1. 5 book_access.module \book_access_node_access_records()
  2. 6 book_access.module \book_access_node_access_records()
  3. 7.2 book_access.module \book_access_node_access_records()
  4. 1.x 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 815
Allows to set the access control for book nodes on a per book basis. It is based on forum_access.module and tac_lite.module.

Code

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