You are here

function hook_webform_results_access in Webform 6.3

Same name and namespace in other branches
  1. 7.4 webform.api.php \hook_webform_results_access()
  2. 7.3 webform.api.php \hook_webform_results_access()

Determine if a user has access to see the results of a webform.

Note in addition to the view access to the results granted here, the $account must also have view access to the Webform node in order to see results.

Parameters

$node: The Webform node to check access on.

$account: The user account to check access on.

Return value

TRUE or FALSE if the user can access the webform results.

See also

webform_results_access().

Related topics

1 invocation of hook_webform_results_access()
webform_results_access in ./webform.module
Menu access callback. Ensure a user both access and node 'view' permission.

File

./webform.api.php, line 507
Sample hooks demonstrating usage in Webform.

Code

function hook_webform_results_access($node, $account) {

  // Let editors view results of unpublished webforms.
  if ($node->status == 0 && in_array('editor', $account->roles)) {
    return TRUE;
  }
  else {
    return FALSE;
  }
}