function book_access_ui_grants_form_access in Book access 6.2
Same name and namespace in other branches
- 7.2 book_access_ui.module \book_access_ui_grants_form_access()
Determines when the book access tab can be shown in the node edit page.
See also
1 string reference to 'book_access_ui_grants_form_access'
- book_access_ui_menu in ./
book_access_ui.module - Implements hook_menu().
File
- ./
book_access_ui.module, line 163 - User interface for the Book access module.
Code
function book_access_ui_grants_form_access($node) {
global $user;
if (!empty($node->book['bid'])) {
if (user_access('administer nodes') || user_access('administer book access')) {
return TRUE;
}
if (user_access('administer access of any books')) {
return TRUE;
}
if ($node->uid == $user->uid && user_access('administer access of own books')) {
return TRUE;
}
return BookAccess::checkGrant($node->book['bid'], 'admin_access');
}
return FALSE;
}