You are here

function hook_book_access_users_grants_alter in Book access 1.x

Same name and namespace in other branches
  1. 6.2 book_access.api.php \hook_book_access_users_grants_alter()
  2. 7.2 book_access.api.php \hook_book_access_users_grants_alter()

Allows other modules to change the roles access permissions for a book.

Parameters

array $uids: The array containing the list of the user IDs.

array $grants: The array of the grants in the format

$grants[$grant][$uid];

.

array $context: An array containing two indexes:

  • the book ID (bid)
  • the node for the book page (node)

File

./book_access.api.php, line 66
Hooks provided by the Book access module.

Code

function hook_book_access_users_grants_alter(array &$uids, array &$grants, array $context) {
  if (isset($uids[1])) {
    $grants['grant_view'][1] = TRUE;
    $grants['grant_update'][1] = TRUE;
    $grants['grant_delete'][1] = TRUE;
  }
}