You are here

public function Checklist::runChecklist in Security Review 8

Runs enabled checks and stores their results.

File

src/Checklist.php, line 137

Class

Checklist
Contains static functions for handling checks throughout every module.

Namespace

Drupal\security_review

Code

public function runChecklist() {
  if ($this->currentUser
    ->hasPermission('run security checks')) {
    $checks = $this
      ->getEnabledChecks();
    $results = $this
      ->runChecks($checks);
    $this
      ->storeResults($results);
    $this->securityReview
      ->setLastRun(time());
  }
  else {
    throw new AccessException();
  }
}