You are here

function webform_share_menu_access in Webform share 7

Same name and namespace in other branches
  1. 6 webform_share.module \webform_share_menu_access()

Menu access callback. Custom check on both the user access and node access.

1 string reference to 'webform_share_menu_access'
webform_share_menu in ./webform_share.module
Implements hook_menu().

File

./webform_share.module, line 73
Module to handle importing and exporting of webforms, as well as adding the ability to set content type defaults.

Code

function webform_share_menu_access($node, $reset = FALSE) {
  if (node_access('update', $node)) {

    // We can only reset if there is some defaults set.
    if ($reset && !webform_share_node_type_defaults($node->type)) {
      return FALSE;
    }
    return user_access('access webform share functionality');
  }
  return FALSE;
}