You are here

function hook_book_access_roles_grants_alter in Book access 7.2

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

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

Parameters

$rids: The array containing the list of the role IDs, as returned by user_roles().

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

$grants[$grant][$rid];

.

$context: An array containing two indexes:

  • the book ID (bid)
  • the node for the book page (node)
1 invocation of hook_book_access_roles_grants_alter()
book_access_ui_grants_form in ./book_access_ui.admin.inc
Form builder for the book access configuration page.

File

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

Code

function hook_book_access_roles_grants_alter(&$rids, &$grants, $context) {
  if (isset($rids[DRUPAL_AUTHENTICATED_RID])) {
    $grants['grant_view'][DRUPAL_AUTHENTICATED_RID] = TRUE;
    $grants['grant_update'][DRUPAL_AUTHENTICATED_RID] = TRUE;
    $grants['grant_delete'][DRUPAL_AUTHENTICATED_RID] = TRUE;
  }
}