With a 'review' node type and a node reference to a 'product ' node type limit number of user reviews to one In a product node type with a review node type that has a reference field to it, how do I only permit one review per user per product node? Do I use the Rules module and if so how do I configure the rule? Do I make a custom query and then unset the Add Review button/link on the product node in a custom module or in template.php?

(edit) Take the example of product reviews on Amazon or muffler repair reviews on Yelp. The user who makes the review  gets one review per listing or item. After they create the review, they can edit it but can't make another one for that listing or item. Seems logical. Likewise the Fivestar rating widget only allows one vote per item so having several reviews for an item will not permit more than just one Fivestar rating.........

Unless somebody has a better solution, I'm going to test -- since the Fivestar widget makes the database query anyway -- if it has been set by the user on the node view. If true then I will disable the Node Reference URL widget button in the links area. If I need more security, I will create code or a Rue that tests on the Node Add page if the Fivestar widget has already been set to disable the Node Add page and redirect the user back to the product.
You might need to try a custom module for this.  Rules are too generic as you can only control a user's right to create a type of content.  If I was to write a module for this, it would go something along these lines:

• Use hook_form_alter to add an extra validation function to your Review node form 
• Check if the user has submitted a review before in the db
• Throw an error if a record exists in the database

Something like the following code should work, but this is untested. 

Edited to note that this is Drupal 6 code but if you use it as a template it shouldn't be too far away. 

&lt;?php

function MYMODULE_form_alter($form_id, &amp;$form) {
    // If the form is a "review" node form
    if ($form_id == 'review_node_form') {
        // Add an extra validation function
        $form['#validate'][] = 'MYMODULE_user_node_limit';
    }
}

// Validation function
function MYMODULE_user_node_limit($node) {
    // Get our logged in user's details
    global $user;
    // Run a database query (something like this)
    $sql = "SELECT {node}.uid \n"
    . "FROM {content_type_review}, {node} "
    . "WHERE {content_type_page}.field_node_ref_nid = {node}.nid "
    . "AND {node}.nid = %d"
    . "AND {node}.uid = %d";
    $result = db_query($sql, $node-&gt;nid, $node-&gt;uid);
    if ($result === FALSE) {
        // Throw error
        drupal_set_message('You have already submitted a review of this item.', 'error');
    }
}
?&gt;


Edited to answer additional comment by asker

Regarding the comment made by Adam S - you could use the code I have already posted in conjunction with the Drupal 7 equivalent of Drupal 6's hook_nodeapi. Here is a list of Drupal 7's node hooks for you to have a look at.  Also, have a look at Eric London's Drupal 6 example of a problem similar to yours of limiting a user's node writing privileges.  Apologies for not providing an exact Drupal 7 example but if you follow the basic premise of Eric London's link but modify it in conjunction with my code, you should be able to solve your problem.