If the server is non local raise an error if
    the path is outside project directories

    Raise a 403 in case of error

def check_path_allowed(path):
    """
    If the server is non local raise an error if
    the path is outside project directories

    Raise a 403 in case of error
    """

    config = Config.instance().get_section_config("Server")

    project_directory = get_default_project_directory()
    if len(os.path.commonprefix([project_directory, path])) == len(project_directory):
        return

    if "local" in config and config.getboolean("local") is False:
        raise aiohttp.web.HTTPForbidden(text="The path is not allowed")