You are here

public function LightweightCronController::access in Scheduler 8

Same name and namespace in other branches
  1. 2.x src/Controller/LightweightCronController.php \Drupal\scheduler\Controller\LightweightCronController::access()

Checks access.

Parameters

string $cron_key: The cron key.

Return value

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

1 string reference to 'LightweightCronController::access'
scheduler.routing.yml in ./scheduler.routing.yml
scheduler.routing.yml

File

src/Controller/LightweightCronController.php, line 65

Class

LightweightCronController
Controller for the lightweight cron.

Namespace

Drupal\scheduler\Controller

Code

public function access($cron_key) {
  $valid_cron_key = $this
    ->config('scheduler.settings')
    ->get('lightweight_cron_access_key');
  return AccessResult::allowedIf($valid_cron_key == $cron_key);
}