def check_path_access(repos, path_parts, pathtype=None, rev=None):
    """Return 1 iff the associated username is permitted to read
    revision REV of the path PATH_PARTS (of type PATHTYPE) in repository
    REPOS, as determined by consulting REPOS's Authorizer object (if any)."""

    auth = repos.authorizer()
    if not auth:
        return 1
    if not pathtype:
        pathtype = repos.itemtype(path_parts, rev)
    return auth.check_path_access(repos.rootname(), path_parts, pathtype, rev)