You are here

public static function WebformOptionsLimitAccess::checkAccess in Webform 6.x

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 'WebformOptionsLimitAccess::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/Access/WebformOptionsLimitAccess.php, line 27

Class

WebformOptionsLimitAccess
Defines the custom access control handler for the webform options limits.

Namespace

Drupal\webform_options_limit\Access

Code

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