Limit users to only one post per content type (D6)

J. Cohen - November 1, 2008 - 01:11

I'm trying to find a way to limit users to be able to post just one node of a certain type. It looks like there are modules for Drupal 5, but not Drupal 6.

Drupal 5 only:
* http://drupal.org/project/node_limitnumber
* http://drupal.org/project/userpoints_contrib
* http://drupal.org/project/nodefamily

Any ideas for an easy way to do this in Drupal 6?

It can be done using the

cog.rusty - November 1, 2008 - 02:49

It can be done using the Rules module (http://drupal.org/project/rules), which is a replacement for the core Triggers module.

First, give the authenticated users permissions to "edit own" posts of that type, but not to create them.

Then, define a role, let's call it "One Time Pass" and give it permission to "create content" of your content type and nothing else.

Assign this role automatically to all new users. (This can be done either with the autoassignrole module or with the rules module itself).

Then, use the rules module to define a triggered rule: When someone saves a node, if the node is of the specified type, and if the author has the "One Time Pass" role, then the "One Time Pass" role is removed from the author. So, the author can edit it (if you want) but can't create another.

Hey cog, would you be willing

Passionate_Lass - June 20, 2009 - 15:37

Hey cog, would you be willing to write up a detailed howto on this specifically the rules portion. :)

2 modules for d6!

zilla - November 1, 2008 - 15:49

solve, i believe, in d6 with:

http://drupal.org/project/create_quota

or

http://drupal.org/project/quota_by_role
........................................................................
i love to waste time: http://twitter.com/passingnotes

true-- but i'm finding more

WorldFallz - November 1, 2008 - 15:53

true-- but i'm finding more and more that the rules module can replace many, if not all, of these little single function modules. It's greatly reducing 'module mania', lol.

===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz

i know, but for new users the modules are 1-click solutions

zilla - November 1, 2008 - 16:05

i think that rules can be very intimidating for new users who just want to have something happen automagically - which means that module mania wil continue until the end of time (or at least drupal's time ;)

OR until people write an awesome "rules cookbook" for standard things like showing how to reproduce each module with a rule instead (and in turn speeding up - possibly - a site that is otherwise using tons of modules)...

........................................................................
i love to waste time: http://twitter.com/passingnotes

There is a place for one:

WorldFallz - November 1, 2008 - 16:15

There is a place for one: http://drupal.org/node/298483 -- i'll have to see about adding some there.

===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz

nice find!

zilla - November 1, 2008 - 23:56

the handbook is getting sooo huge - didn't even realize this was in there..

........................................................................
i love to waste time: http://twitter.com/passingnotes

 
 

Drupal is a registered trademark of Dries Buytaert.