You are here

function hook_webform_submission_access in Webform 7.4

Same name and namespace in other branches
  1. 8.5 webform.api.php \hook_webform_submission_access()
  2. 6.3 webform.api.php \hook_webform_submission_access()
  3. 7.3 webform.api.php \hook_webform_submission_access()
  4. 6.x webform.api.php \hook_webform_submission_access()

Alter access to a Webform submission.

Parameters

$node: The Webform node on which this submission was made.

$submission: The Webform submission.

$op: The operation to be performed on the submission. Possible values are:

  • "view"
  • "edit"
  • "delete"
  • "list"

$account: A user account object.

Return value

bool TRUE if the current user has access to submission, or FALSE otherwise.

Related topics

1 invocation of hook_webform_submission_access()
webform_submission_access in ./webform.module
Access function for Webform submissions.

File

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

Code

function hook_webform_submission_access($node, $submission, $op = 'view', $account = NULL) {
  switch ($op) {
    case 'view':
      return TRUE;
    case 'edit':
      return FALSE;
    case 'delete':
      return TRUE;
    case 'list':
      return TRUE;
  }
}