You are here

public function TFTController::accessAjaxGetFolder in Taxonomy File Tree 8

Same name and namespace in other branches
  1. 3.x src/Controller/TFTController.php \Drupal\tft\Controller\TFTController::accessAjaxGetFolder()

Returns folder access flag.

Parameters

\Drupal\Core\Session\AccountInterface $account: User account.

Return value

\Drupal\Core\Access\AccessResult Access flag.

1 string reference to 'TFTController::accessAjaxGetFolder'
tft.routing.yml in ./tft.routing.yml
tft.routing.yml

File

src/Controller/TFTController.php, line 608

Class

TFTController
Class TFTController.

Namespace

Drupal\tft\Controller

Code

public function accessAjaxGetFolder(AccountInterface $account) {
  $tid = $_GET['tid'];
  $term = Term::load($tid);
  if (isset($term) && $term
    ->access('view', $account)) {
    return AccessResult::allowed();
  }
  return AccessResult::forbidden();
}