You are here

function webform_node_update_access in Webform 7.4

Menu access callback. Ensure a sure has access to update a webform node.

Unlike webform_results_access and webform_results_clear_access, access is completely overridden by the any implementation of hook_webform_update_access.

If hook_webform_update_access is implemented by one or more other modules, the results must be unanimously TRUE for access to be granted; otherwise it is denied if even one implementation returns FALSE, regardless of node_access and the 'edit webform components' permission. This allows implementors complete flexibility.

hook_webform_update_access should return TRUE if access should absolutely be granted, FALSE if it should absolutely be denied, or NULL if node_access and 'edit webform components' permission should determine access.

See also

hook_webform_update_access()

1 call to webform_node_update_access()
WebformConditionals::reportErrors in includes/webform.webformconditionals.inc
Displays and error messages from the previously-generated sort order.
1 string reference to 'webform_node_update_access'
webform_menu in ./webform.module
Implements hook_menu().

File

./webform.module, line 727
This module provides a simple way to create forms and questionnaires.

Code

function webform_node_update_access($node, $account = NULL) {
  global $user;
  $account = isset($account) ? $account : $user;
  $module_access = module_invoke_all('webform_update_access', $node, $account);
  return empty($module_access) ? node_access('update', $node, $account) && user_access('edit webform components') : count(array_filter($module_access)) == count($module_access);
}