import tempfile


def validate_directory_access(path, mode):
    """
    Check if a directory can be accessed in the specified mode by the current
    user.

    Args:
        path (str): Path to check the access rights of.
        mode (str): access mode we want to validate for the path

    Returns:
        (bool): True or False based on the availability of the access rights to
            the user for the provided path.
    """
    try:
        tempfile.NamedTemporaryFile(mode=mode, dir=path, delete=True)
    except (IOError, OSError):
        return False
    return True