function export_access in Node export 6
Same name and namespace in other branches
- 5.2 export.module \export_access()
- 5 export.module \export_access()
1 call to export_access()
1 string reference to 'export_access'
- export_menu in ./
export.module - Implementation of hook_menu().
File
- ./
export.module, line 56
Code
function export_access($node) {
global $user;
// Check basic permissions first.
$access = user_access('export node') || $user->uid && $node->uid == $user->uid && user_access('export own nodes');
// Make sure the user can view the original node content.
$access = $access && node_access('view', $node);
// Check additional conditions
$access = $access && (export_is_permitted($node->type) && filter_access($node->format) && node_access('create', $node->type));
// Let other modules alter this - for exmple to only allow some users
// to export specific nodes or types.
drupal_alter("export_access", $access, $node);
return $access;
}