You are here

function epub_read_access_callback in Epub 6

Determine whether the user can download an ePub or not.

Parameters

$nid: An integer containing node id.

$perm: The permission, such as "administer nodes", being checked for.

Return value

A boolean value telling if the user has the rights to access the content.

1 string reference to 'epub_read_access_callback'
epub_menu in ./epub.module
Implementation of hook_menu().

File

./epub.module, line 412
Provide ePub content type and enable the creation of ePub files from book contents.

Code

function epub_read_access_callback($nid, $perm) {
  $node = node_load(array(
    'nid' => $nid,
  ));
  return ($node->type === 'book' || $node->type === 'epub' && _epub_links_book($node->bid)) && user_access($perm);
}