How can I limit count of content object per user?

Author Message

Andrey PAA

Monday 20 March 2006 10:26:19 am

How can I limit count of content object specified type per user?
(for example the user can add only 3 article on site)

Kristof Coomans

Monday 20 March 2006 11:57:28 am

This isn't possible at the moment.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Łukasz Serwatka

Monday 20 March 2006 12:13:30 pm

I'm not sure how complex solution do you need but if you want to limit only to count but not to count per class you can extend user class with new attribute. Then set default count for all users. In tpl fetch count (see on-line doc for more info) of created objects in the system check that count with with current logged in user attribute then show create input button or hide it. This can work without special operators. If you need something more e.g count per class or let's say limit for whole user group, then you will need to do some PHP coding, since like Kristof wrote this is not possible at the moment.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Jan Komárek

Thursday 22 April 2010 5:56:25 pm

Hello, any change on this? I would like to limit count of photos, but I dont want to use attributtes, because of 50 image attributes dont look as a good solution for me.

If nothing change in this casem as I am expectiong. Can you please give me some direction about php coding which will be necesary?

Thank you

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 05:18:04
Script start
Timing: Jan 18 2025 05:18:04
Module start 'layout'
Timing: Jan 18 2025 05:18:04
Module start 'content'
Timing: Jan 18 2025 05:18:04
Module end 'content'
Timing: Jan 18 2025 05:18:05
Script end

Main resources:

Total runtime0.0403 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0204 588.0625152.6406
Module start 'layout' 0.02040.0033 740.703139.4766
Module start 'content' 0.02370.0142 780.179793.3672
Module end 'content' 0.03790.0023 873.546934.3047
Script end 0.0402  907.8516 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00266.4841140.0002
Check MTime0.00122.8638140.0001
Mysql Total
Database connection0.015237.766610.0152
Mysqli_queries0.00338.118330.0011
Looping result0.00000.042110.0000
Template Total0.00184.610.0018
Template load0.00082.054710.0008
Template processing0.00102.491910.0010
Override
Cache load0.00061.443510.0006
General
dbfile0.005112.744380.0006
String conversion0.00000.021940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs