You are here

function _book_access_node_access_records_users in Book access 6

Gets the list of grant records assigned to users for a book.

Parameters

$grants: An array of grants.

$bid: The ID of the book for which the function returns the grant records.

2 calls to _book_access_node_access_records_users()
book_access_node_access_records in ./book_access.module
Implements hook_node_access_records().
_book_access_build_node_grants in ./book_access.module
Rebuilds the book page grants for the node passed as argument.

File

./book_access.module, line 475
Allows 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_users(&$grants, $bid) {
  $result = db_query("SELECT * FROM {book_access_user} WHERE nid = %d", $bid);
  while ($grant = db_fetch_object($result)) {
    $grants[] = array(
      'realm' => 'book_access_user',
      'gid' => $grant->uid,
      'grant_view' => $grant->grant_view,
      'grant_update' => $grant->grant_update,
      'grant_delete' => $grant->grant_delete,
      'priority' => BOOK_ACCESS_GRANT_PRIORITY,
    );
  }
}