'Insert a record into this resource
@param fields: dict of field/value pairs to insert'

def insert(self, **fields):

    table = self.table
    tablename = self.tablename
    authorised = current.auth.s3_has_permission('create', tablename)
    if (not authorised):
        from s3error import S3PermissionError
        raise S3PermissionError(('Operation    not    permitted:    INSERT    INTO    %s' % tablename))
    record_id = self.table.insert(**fields)
    if record_id:
        current.audit('create', self.prefix, self.name, record=record_id)
        record = Storage(fields)
        record.id = record_id
        s3db = current.s3db
        s3db.update_super(table, record)
        auth = current.auth
        auth.s3_set_record_owner(table, record_id)
        auth.s3_make_session_owner(table, record_id)
        s3db.onaccept(tablename, record, method='create')
    return record_id
