You are here

function webform_results_access in Webform 7.4

Same name and namespace in other branches
  1. 5.2 webform.module \webform_results_access()
  2. 6.3 webform.module \webform_results_access()
  3. 6.2 webform.module \webform_results_access()
  4. 7.3 webform.module \webform_results_access()

Menu access callback. Ensure a user both access and node 'view' permission.

13 calls to webform_results_access()
hook_webform_submission_actions in ./webform.api.php
Provide a list of actions that can be executed on a submission.
theme_webform_results_submissions_header in includes/webform.report.inc
Theme the header of the submissions table.
webform_component_edit_form in includes/webform.components.inc
Form to configure a webform component.
webform_handler_field_node_link_results::render_link in views/webform_handler_field_node_link_results.inc
Renders the link.
webform_handler_field_submission_count::render in views/webform_handler_field_submission_count.inc
Render the field.

... See full list

1 string reference to 'webform_results_access'
webform_menu in ./webform.module
Implements hook_menu().

File

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

Code

function webform_results_access($node, $account = NULL) {
  global $user;
  $account = isset($account) ? $account : $user;
  $module_access = count(array_filter(module_invoke_all('webform_results_access', $node, $account))) > 0;
  return node_access('view', $node, $account) && ($module_access || user_access('access all webform results', $account) || user_access('access own webform results', $account) && $account->uid == $node->uid);
}