Best approach to limit users to a single node of a given content type in Drupal
Posted
by Chaulky
on Stack Overflow
See other posts from Stack Overflow
or by Chaulky
Published on 2010-05-03T05:57:21Z
Indexed on
2010/05/03
6:08 UTC
Read the original article
Hit count: 241
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?
© Stack Overflow or respective owner