public static function WebformEmailReplyForm::checkReplyAccess in Webform Email Reply 8
Check that webform submission resend access check.
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.
1 string reference to 'WebformEmailReplyForm::checkReplyAccess'
File
- src/
Form/ WebformEmailReplyForm.php, line 90  - Contains \Drupal\webform_email_reply\Form\WebformEmailReplyForm.
 
Class
Namespace
Drupal\webform_email_reply\FormCode
public static function checkReplyAccess(WebformSubmissionInterface $webform_submission, AccountInterface $account) {
  if ($webform_submission
    ->getWebform()
    ->hasMessageHandler()) {
    if ($account
      ->hasPermission('send email replies to all webforms') || $account
      ->hasPermission('send email replies to own webforms')) {
      return AccessResult::allowed();
    }
  }
  return AccessResult::forbidden();
}