You are here

function ctools_term_vocabulary_ctools_access_check in Chaos Tool Suite (ctools) 6

Same name and namespace in other branches
  1. 7 plugins/access/term_vocabulary.inc \ctools_term_vocabulary_ctools_access_check()

Check for access.

1 string reference to 'ctools_term_vocabulary_ctools_access_check'
term_vocabulary.inc in plugins/access/term_vocabulary.inc
Plugin to provide access control based upon term vocabulary

File

plugins/access/term_vocabulary.inc, line 52
Plugin to provide access control based upon term vocabulary

Code

function ctools_term_vocabulary_ctools_access_check($conf, $context) {

  // As far as I know there should always be a context at this point, but this
  // is safe.
  if (empty($context) || empty($context->data) || empty($context->data->vid)) {
    return FALSE;
  }
  if (array_filter($conf['vids']) && empty($conf['vids'][$context->data->vid])) {
    return FALSE;
  }
  return TRUE;
}