Determine whether or not the routes can be written
@return boolean
183749
public function canWriteRoutes()
    {
        if (!is_null($this->bCanWriteRoutes)) {
            return $this->bCanWriteRoutes;
        }

        //  First, test if file exists, if it does is it writable?
        if (file_exists(static::ROUTES_DIR . static::ROUTES_FILE)) {

            if (is_writable(static::ROUTES_DIR . static::ROUTES_FILE)) {

                $this->bCanWriteRoutes = true;
                return true;

            } else {

                //  Attempt to chmod the file
                if (@chmod(static::ROUTES_DIR . static::ROUTES_FILE, FILE_WRITE_MODE)) {

                    $this->bCanWriteRoutes = true;
                    return true;

                } else {

                    $this->setError('The route config exists, but is not writable.');
                    $this->bCanWriteRoutes = false;
                    return false;
                }
            }

        } elseif (is_writable(static::ROUTES_DIR)) {

            $this->bCanWriteRoutes = true;
            return true;

        } else {

            //  Attempt to chmod the directory
            if (@chmod(static::ROUTES_DIR, DIR_WRITE_MODE)) {

                $this->bCanWriteRoutes = true;
                return true;

            } else {

                $this->setError('The route directory is not writable. <small>' . static::ROUTES_DIR . '</small>');
                $this->bCanWriteRoutes = false;
                return false;
            }
        }
    }
625816
public function isWritable() {

		if(false !== $this -> directory -> getExists()) {

			$this -> refresh();
			
			return $this -> directory -> getWritable();
		}

		return false;
	}
108840
public function isWriteAllowed()
    {
        $msgRepl = ['%s' => $this->relPath];

        // No file, directory not writable
        if (!file_exists($this->absPath) && (!is_writable(dirname($this->absPath)) && !is_writable(dirname(dirname($this->absPath))))) {
            $msg = Trans::__(
                "The translations file '%s' can't be created. You will have to use your own editor to make modifications to this file.",
                $msgRepl
            );
            $this->app['logger.flash']->warning($msg);

        // Have a file, but not writable
        } elseif (file_exists($this->absPath) && !is_writable($this->absPath)) {
            $msg = Trans::__(
                'general.phrase.file-not-writable',
                $msgRepl
            );
            $this->app['logger.flash']->warning($msg);

        // File is not readable: abort
        } elseif (file_exists($this->absPath) && !is_readable($this->absPath)) {
            $msg = Trans::__('general.phrase.error-translation-file-not-readable', $msgRepl);
            $this->app->abort(Response::HTTP_NOT_FOUND, $msg);

        // File is writeable
        } else {
            return true;
        }

        return false;
    }
574043
protected function routeCanBeShown($route): bool
    {
        return ($route->canBeShown() && $route->getRoutable()->canBeShown() || $this->gate->allows('viewInactive', $route));
    }
911220
public function canRead()
    {
        $c = Page::getByPath('/dashboard', 'ACTIVE');
        if ($c && !$c->isError()) {
            $cp = new Permissions($c);

            return $cp->canViewPage();
        }
    }
817372
public function isWritable()
    {
        if (!is_resource($this->resource)) {
            return false;
        }

        $meta = stream_get_meta_data($this->resource);

        return is_writable($meta['uri']);
    }
431798
private function checkPermissions()
    {
        foreach ($this->writableDirectories as $path) {
            if (!$this->filesystem->isWritable(base_path($path))) {
                $this->console->error($path . ' is not writable');
                $this->errors = true;
            }
        }
    }
466718
public function isUrlRewritingEnabled()
    {
        $urlRewritingEnabled = $this->getConfig('rewrite_url');
        if ($urlRewritingEnabled !== null) {
            return $urlRewritingEnabled;
        }

        if (isset($_SERVER['PICO_URL_REWRITING'])) {
            $this->config['rewrite_url'] = (bool) $_SERVER['PICO_URL_REWRITING'];
        } elseif (isset($_SERVER['REDIRECT_PICO_URL_REWRITING'])) {
            $this->config['rewrite_url'] = (bool) $_SERVER['REDIRECT_PICO_URL_REWRITING'];
        } else {
            $this->config['rewrite_url'] = false;
        }

        return $this->config['rewrite_url'];
    }
472705
public function isWritable(): bool
    {
        if (!file_exists($this->filepath)) {
            return $this->isWritablePath($this->getPath());
        }

        return is_writable($this->filepath) && is_file($this->filepath);
    }
829678
public function isMethodFailure(): bool
    {
        if ($this->isSuccess() || $this->allowedMethods === self::HTTP_METHOD_ANY) {
            return false;
        }

        return true;
    }
869641
function canRoute(url) {
	for (let i=ROUTERS.length; i--; ) {
		if (ROUTERS[i].canRoute(url)) return true;
	}
	return false;
}
884431
public function isRouteAllowed()
	{
		return $this->_redirected || in_array(Request::getRequestMethod(), $this->getRoute()->getMethods()) === true;
	}
22957
private function routable() : bool
  {
    $routesFolder = config('app.dir') . 'routes' . DIRECTORY_SEPARATOR;

    if (!file_exists($routesFolder . 'api.php' )) {
      $this->exception('Could not find api routes.');
      return false;
    }

    if (!file_exists($routesFolder . 'web.php' )) {
      $this->exception('Could not find web routes.');
      return false;
    }

    return true;
  }
493499
public function canHandle(): bool
    {
        if ($this->table !== 'pages') {
            return false;
        }

        if (!$this->backendUser->isAdmin()) {
            return false;
        }

        /** @var $rootPageResolver RootPageResolver */
        $rootPageResolver = GeneralUtility::makeInstance(RootPageResolver::class);
        return $rootPageResolver->getIsRootPageId((int)$this->identifier);
    }
1192199
protected function isWritable($path) {
        if (!is_dir($path)) {
            // Path does not exist, check parent
            return $this->isWritable(dirname($path));
        }

        // Dir exists, check if it's writable
        return is_writable($path);
    }
825706
public function isWritable($additionalPath = '')
    {
        $path = $this->realPath($additionalPath);
        
        if ($path === false || !is_writable($path)) {
            return false;
        }
        
        return true;
    }
1300084
function _verifyIsBannedRoute($currentRoute)
    {
        $r = false;

        $currentRoute = rtrim($currentRoute, '/');
        foreach ($this->routesDenied as $deniedRoute) {
            $deniedRoute = rtrim($deniedRoute, '/');
            $allowLeft = false;
            if (substr($deniedRoute, -1) == '*') {
                // remove star
                $allowLeft = true;
                $deniedRoute = substr($deniedRoute, 0, strlen($deniedRoute) -1 );
            }

            if ( ($left = str_replace($deniedRoute, '', $currentRoute)) !== $currentRoute ) {
                if ($allowLeft || $left == '')
                    return true;
            }
        }

        return $r;
    }