You are here

public static function WebformOptionsLimitController::checkAccess in Webform 8.5

Check whether the webform option limits summary.

Parameters

\Drupal\webform\WebformInterface $webform: A webform.

Return value

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

1 string reference to 'WebformOptionsLimitController::checkAccess'
webform_options_limit.routing.yml in modules/webform_options_limit/webform_options_limit.routing.yml
modules/webform_options_limit/webform_options_limit.routing.yml

File

modules/webform_options_limit/src/Controller/WebformOptionsLimitController.php, line 78

Class

WebformOptionsLimitController
Provides route responses for webform options limit.

Namespace

Drupal\webform_options_limit\Controller

Code

public static function checkAccess(WebformInterface $webform) {
  if (!static::hasOptionsLimit($webform)) {
    return AccessResult::forbidden()
      ->addCacheableDependency($webform);
  }
  return WebformEntityAccess::checkResultsAccess($webform);
}