def ctx_exit(obj, path, access):
    """
    Called on context exit. if ``access='w'`` dumps ``obj`` into
    file specified by ``path``.

    :param obj: object to be dumped
    :param path: file path
    :param access: access permission ('r' - read, 'w' - write, 'rw' - edit)
    """
    if 'w' in access:
        obj.dump(path)
