'Removes session ownership for a record
@param table: the table or table name (default: all tables)
@param record_id: the record ID (default: all records)'

def s3_clear_session_ownership(self, table=None, record_id=None):

    session = current.session
    if ('owned_records' not in session):
        return
    if (table is not None):
        if hasattr(table, '_tablename'):
            tablename = original_tablename(table)
        else:
            tablename = table
        if (tablename in session.owned_records):
            if record_id:
                record_id = str(record_id)
                records = session.owned_records[tablename]
                if (record_id in records):
                    records.remove(record_id)
            else:
                del session.owned_records[tablename]
    else:
        session.owned_records = {}
