You are here

public function SolrConfigForm::access in Search API Solr 8

Same name and namespace in other branches
  1. 8.3 src/Form/SolrConfigForm.php \Drupal\search_api_solr\Form\SolrConfigForm::access()
  2. 8.2 src/Form/SolrConfigForm.php \Drupal\search_api_solr\Form\SolrConfigForm::access()
  3. 4.x src/Form/SolrConfigForm.php \Drupal\search_api_solr\Form\SolrConfigForm::access()

Checks access for the Solr config form.

Parameters

\Drupal\search_api\ServerInterface $search_api_server: The server for which access should be tested.

Return value

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

1 string reference to 'SolrConfigForm::access'
search_api_solr.routing.yml in ./search_api_solr.routing.yml
search_api_solr.routing.yml

File

src/Form/SolrConfigForm.php, line 95

Class

SolrConfigForm
A basic form with a passed entity with an interface.

Namespace

Drupal\search_api_solr\Form

Code

public function access(ServerInterface $search_api_server) {
  return AccessResult::allowedIf($search_api_server
    ->hasValidBackend() && $search_api_server
    ->getBackend() instanceof SearchApiSolrBackend)
    ->addCacheableDependency($search_api_server);
}