You are here

public function ViewsAccess::evaluatePlain in Security Review 8

Evaluates a CheckResult and returns a plaintext output.

Parameters

\Drupal\security_review\CheckResult $result: The check result to evaluate.

Return value

string The evaluation string.

Overrides Check::evaluatePlain

File

src/Checks/ViewsAccess.php, line 117

Class

ViewsAccess
Checks for Views that do not check access.

Namespace

Drupal\security_review\Checks

Code

public function evaluatePlain(CheckResult $result) {
  $findings = $result
    ->findings();
  if (empty($findings)) {
    return '';
  }
  $output = $this
    ->t('Views without access check:') . ":\n";
  foreach ($findings as $view_id => $displays) {
    $output .= "\t" . $view_id . ": " . implode(', ', $displays) . "\n";
  }
  return $output;
}