views:

40

answers:

1

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?

+2  A: 

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

henrijs
i menan approach 1) could be better if you have giga site where hardcore optimization is needed
henrijs
wow, i thought i had looked thoroughly at the contrib modules... guess not. thanks for the links. I'll accept answer if one works out for me
Chaulky
ended up that a fellow developer already got the role switching approach working, so we're not going to mess with it. But I appreciate the links and will likely find need for one of those modules in the future
Chaulky