You are here

public static function DefaultController::checkReplyAccess in Webform Email Reply 8

Check that webform submission view permisiion.

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 'DefaultController::checkReplyAccess'
webform_email_reply.routing.yml in ./webform_email_reply.routing.yml
webform_email_reply.routing.yml

File

src/Controller/DefaultController.php, line 84
Contains \Drupal\webform_email_reply\Controller\DefaultController.

Class

DefaultController
Default controller for the webform_email_reply module.

Namespace

Drupal\webform_email_reply\Controller

Code

public static function checkReplyAccess(AccountInterface $account) {
  if ($account
    ->hasPermission('send email replies to all webforms') || $account
    ->hasPermission('send email replies to own webforms')) {
    return AccessResult::allowed();
  }
  return AccessResult::forbidden();
}