protected function checkNode($resourceUri, $roles) {
        //Break up the uri on the slashes
        $nodes = preg_split('/(\\\|\\/)/', $resourceUri, -1, PREG_SPLIT_NO_EMPTY);

        //Setup the valid flag
        $valid = false;

        //Go through the config until the resource is found, or its closest node and return what valid was at that point
        $ptr = &$this->config;
        foreach($nodes as $node) {
            if (isset($ptr[$node])) {
                //Increment the pointer
                $ptr = &$ptr[$node];
                //Check if valid at this node
                if (isset($ptr['_roles'])) {
                    //If the user has any of the roles required to see the resource, set valid to true, else set it to false
                    if (0 < count(array_intersect($ptr['_roles'], $roles))) {
                        $valid = true;
                    } else {
                        $valid = false;
                    }
                }
            } else {
                break;
            }
        }

        //return the valid flag
        return $valid;
    }