'Checks whether the current session owns a record
@param table: the table or table name
@param record_id: the record ID'

def s3_session_owns(self, table, record_id):

    session = current.session
    if (self.user or (not record_id) or ('owned_records' not in session)):
        return False
    if hasattr(table, '_tablename'):
        tablename = original_tablename(table)
    else:
        tablename = table
    records = session.owned_records.get(tablename)
    if records:
        return (str(record_id) in records)
    return False
