Search code examples
drupaldrupal-6roleslimit

Best approach to limit users to a single node of a given content type in Drupal


I need to limit users to a single node of a given content type. So a user can only create one node of TypeX. I've come up with two approaches. Which would be better to use...

1) Edit the node/add/typex menu item to check the database to see if the user has already created a node of TypeX, as well as if they have permissions to create it.

2) When a user creates a node of TypeX, assign them to a different role that doesn't have permissions to create that type of node.

In approach 1, I have to make an additional database call on every page load to see if they should be able to see the "Create TypeX" (node/add/typex). But in approach 2, I have to maintain two separate roles.

Which approach would you use?


Solution

  • http://drupal.org/project/node_limit

    UPDATE: this is even better, updated week ago, first one is not updated in a year

    http://drupal.org/project/node_limitnumber