You are here

public function ACKNodeTaxonomyIndex::objectRealms in Access Control Kit 7

Overrides AccessControlKitHandler::objectRealms().

Overrides AccessControlKitHandler::objectRealms

File

ack_node/handlers/ack_node_taxonomy_index.inc, line 39
Contains the handler class for the taxonomy term node index.

Class

ACKNodeTaxonomyIndex
Controls access to a node based on its relationship to a term in the index.

Code

public function objectRealms($object_type, $node) {
  $query = db_select('taxonomy_index', 'i');
  $query
    ->join('taxonomy_term_data', 't', 'i.tid = t.tid');
  $query
    ->join('taxonomy_vocabulary', 'v', 't.vid = v.vid');
  $query
    ->fields('i', array(
    'tid',
  ))
    ->condition('i.nid', $node->nid)
    ->condition('v.machine_name', $this->vocabulary);
  $result = $query
    ->execute();
  return $result
    ->fetchCol();
}