public function resourceInheritsFrom($resource, $inherit, $onlyParent = FALSE)
{
$this->checkResource($resource);
$this->checkResource($inherit);
if ($this->resources[$resource]['parent'] === NULL) {
return FALSE;
}
$parent = $this->resources[$resource]['parent'];
if ($inherit === $parent) {
return TRUE;
} elseif ($onlyParent) {
return FALSE;
}
while ($this->resources[$parent]['parent'] !== NULL) {
$parent = $this->resources[$parent]['parent'];
if ($inherit === $parent) {
return TRUE;
}
}
return FALSE;
}