public function TaskController::executeTasksAccess in Search API 8
Checks access for executing pending tasks.
Parameters
\Drupal\Core\Session\AccountInterface $account: Run access checks for this account.
Return value
\Drupal\Core\Access\AccessResultInterface The access result.
1 string reference to 'TaskController::executeTasksAccess'
File
- src/
Controller/ TaskController.php, line 76
Class
- TaskController
- Returns responses for task-related routes.
Namespace
Drupal\search_api\ControllerCode
public function executeTasksAccess(AccountInterface $account) {
if ($this->taskManager
->getTasksCount()) {
return AccessResult::allowedIfHasPermission($account, 'administer search_api')
->addCacheTags([
'search_api_task_list',
]);
}
return AccessResult::forbidden()
->addCacheTags([
'search_api_task_list',
]);
}