1 taxonomy_term_depth_access.inc public TaxonomyTermDepthLayoutAccess::checkAccess()

Checks for access based on the available context.

Return value

boolean: The result of the access check.

Overrides LayoutAccess::checkAccess

File

core/modules/taxonomy/layout/taxonomy_term_depth_access.inc, line 64
Plugin to provide access control based upon taxonomy term depth.

Class

TaxonomyTermDepthLayoutAccess
@file Plugin to provide access control based upon taxonomy term depth.

Code

public function checkAccess() {
  if (!isset($this->contexts['taxonomy_term']->data)) {
    return FALSE;
  }

  $tid = $this->contexts['taxonomy_term']->data->tid;
  $depth = $this->getTermDepth($tid);

  if ($depth == $this->settings['depth']) {
    return TRUE;
  }

  return FALSE;
}