You are here

protected function CSRFTokenAccessCheck::hasRestrictedMethod in Services 9.0.x

Same name and namespace in other branches
  1. 8.4 src/Access/CSRFTokenAccessCheck.php \Drupal\services\Access\CSRFTokenAccessCheck::hasRestrictedMethod()

Determine if the methods are restricted.

Parameters

array $methods: An array of HTTP methods.

Return value

bool Return TRUE if a restricted method was found; otherwise FALSE.

1 call to CSRFTokenAccessCheck::hasRestrictedMethod()
CSRFTokenAccessCheck::applies in src/Access/CSRFTokenAccessCheck.php
Declares whether the access check applies to a specific route or not.

File

src/Access/CSRFTokenAccessCheck.php, line 82

Class

CSRFTokenAccessCheck
Class \Drupal\services\Access\CSRFTokenAccessCheck.

Namespace

Drupal\services\Access

Code

protected function hasRestrictedMethod(array $methods) {
  foreach ($methods as $method) {
    if (in_array(strtoupper($method), $this
      ->restrictedMethods())) {
      return TRUE;
    }
  }
  return FALSE;
}