Created
May 24, 2009 21:39
-
-
Save dawehner/117270 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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