public function isAllowed(RequestInterface $uri)
    {
        if (preg_match(sprintf('#^%s$#', $this->regexp), $uri->getUri()->getPath())) {
            if (isset($this->assertion)) {
                $assertion = $this->assertion;

                return $assertion();
            } else {
                return true;
            }
        }

        return true;
    }