You are here

public static function WebformSubmissionAccess::checkResendAccess in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Access/WebformSubmissionAccess.php \Drupal\webform\Access\WebformSubmissionAccess::checkResendAccess()

Check that webform submission has (email) messages and the user can update any webform submission.

Parameters

\Drupal\webform\WebformSubmissionInterface $webform_submission: A webform submission.

\Drupal\Core\Session\AccountInterface $account: Run access checks for this account.

Return value

\Drupal\Core\Access\AccessResultInterface The access result.

2 calls to WebformSubmissionAccess::checkResendAccess()
WebformNodeAccess::checkWebformSubmissionAccess in modules/webform_node/src/Access/WebformNodeAccess.php
Check whether the user can access a node's webform submission.
WebformSubmissionAccessTest::testWebformSubmissionAccess in tests/src/Unit/Access/WebformSubmissionAccessTest.php
Tests the check webform submission access.
1 string reference to 'WebformSubmissionAccess::checkResendAccess'
webform.routing.yml in ./webform.routing.yml
webform.routing.yml

File

src/Access/WebformSubmissionAccess.php, line 51

Class

WebformSubmissionAccess
Defines the custom access control handler for the webform submission entities.

Namespace

Drupal\webform\Access

Code

public static function checkResendAccess(WebformSubmissionInterface $webform_submission, AccountInterface $account) {
  if ($webform_submission
    ->getWebform()
    ->hasMessageHandler()) {
    return AccessResult::allowed();
  }
  else {
    return AccessResult::forbidden();
  }
}