Skip to content

Instantly share code, notes, and snippets.

@dawehner
Created May 24, 2009 21:39
Show Gist options
  • Save dawehner/117270 to your computer and use it in GitHub Desktop.
Save dawehner/117270 to your computer and use it in GitHub Desktop.
<?php
// $Id$
/**
* Returns access-
*
* @param $node
* The full node object, which should be proved.
* @param $terms
* The terms the user has access to.
* @param $vid
* The vid which should be used for checking.
*/
function pt_compare_access($node, $terms, $vid) {
$access = FALSE;
foreach ($node->taxonomy as $term) {
if ($term->vid == $vid) {
$nodeterms[] = $term->name;
}
}
foreach ($nodeterms as $term) {
$access |= in_array($term, $terms);
}
return $access;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment