Hi there

Is it possible to create a rule to allow certain users to add more content than others based on username NOT user role?

Thanks!

Comments

weka’s picture

Yes, limits can be applied to roles, users, dates, or anything that can be accessed using PHP.
See the issue #812966: Add documentation about conflicting limits about conflicts etc.

GlitchFreak’s picture

So just to clarify, should I access the rule on the node via php or create the rule including the php inside it?

Thanks!

weka’s picture

I would create new rule and add PHP condition. There may be some examples in the issue queue.

GlitchFreak’s picture

Apologies, can you please give me a quick example of how I would go about creating this rule? I'm not sure where to put the php.

Thanks!!

weka’s picture

While adding a condition to a rule use the option Execute custom PHP code.

GlitchFreak’s picture

Thanks Weka.

I'm really stuck regarding how to structure the code.

I'm trying to limit all users but allow certain users to create more than one node. Would it be easier to allocate those specific users to a role and then base the node limit on the role? If so, could you maybe give me some code as a starting point please?

Much appreciated, thanks!

weka’s picture

Title: Limit Node Creation per User » How to limit all users but allow certain users to create more than one node

Sorry, I can't help you with that, maybe someone else will.