Nette\Security\Permission::resourceInheritsFrom PHP Метод

resourceInheritsFrom() публичный Метод

Returns TRUE if $resource inherits from $inherit. If $onlyParents is TRUE, then $resource must inherit directly from $inherit.
public resourceInheritsFrom ( $resource, $inherit, $onlyParent = FALSE ) : boolean
Результат boolean
    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;
    }