You are here

public function ViewsAutocompleteFiltersController::access in Views Autocomplete Filters 8

Access for the autocomplete filters path.

Determine if the given user has access to the view. Note that this sets the display handler if it hasn't been.

Parameters

string $view_name: The View name.

string $view_display: The View display.

Return value

bool.

1 string reference to 'ViewsAutocompleteFiltersController::access'
views_autocomplete_filters.routing.yml in ./views_autocomplete_filters.routing.yml
views_autocomplete_filters.routing.yml

File

src/Controller/ViewsAutocompleteFiltersController.php, line 62

Class

ViewsAutocompleteFiltersController
Returns autocomplete responses for taxonomy terms.

Namespace

Drupal\views_autocomplete_filters\Controller

Code

public function access($view_name, $view_display) {

  // Determine if the given user has access to the view. Note that
  // this sets the display handler if it hasn't been.
  $view = Views::getView($view_name);
  if ($view
    ->access($view_display)) {
    return AccessResult::allowed();
  }
  return AccessResult::forbidden();
}