You are here

function book_access_init in Book access 7.2

Implements hook_init().

Sets up some default variables.

File

./book_access.module, line 822
Allows to set the access control for book nodes on a per book basis. Based on forum_access.module and tac_lite.module.

Code

function book_access_init() {
  $roles = user_roles();
  $authorDefaults = BookAccess::defaultAuthorGrants();
  if (variable_get('book_access_default_author_access') === NULL) {
    variable_set('book_access_default_author_access', $authorDefaults);
  }
  foreach ($roles as $rid => $rname) {
    BookAccess::setDefaultForRole($rid, $rname);
  }
}