Limit user's ability to create 1 or X objects of a class

Author Message

Piotrek Karaś

Tuesday 11 December 2007 4:34:32 am

Hello everyone,

Has anyone tried to limit user's ability to create more than 1or X objects of a given class? I would suspect 1 would be the most common scenario, but other number would also be interesting.

I have a solution in mind, but I thought I'd check before I spend hours implementing it ;)

Thanks for any suggestions!
Piotrek

--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu

Piotrek Karaś

Tuesday 11 December 2007 10:48:54 pm

No response, so I spent those hours and something came out of it:
http://ez.no/developer/contribs/datatypes/ez_user_create_limit

This is totally raw and not stable (but not necessarily unstable ;)
But should be enough just to get the idea.

I would be grateful for any feedback.
Thanks.

--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu

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 19 2025 04:34:38
Script start
Timing: Jan 19 2025 04:34:38
Module start 'layout'
Timing: Jan 19 2025 04:34:38
Module start 'content'
Timing: Jan 19 2025 04:34:38
Module end 'content'
Timing: Jan 19 2025 04:34:38
Script end

Main resources:

Total runtime0.0261 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.0073 589.4141152.6563
Module start 'layout' 0.00730.0067 742.070339.5078
Module start 'content' 0.01400.0090 781.578189.3984
Module end 'content' 0.02300.0028 870.976634.3047
Script end 0.0258  905.2813 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.003413.1111140.0002
Check MTime0.00124.5375140.0001
Mysql Total
Database connection0.00072.705110.0007
Mysqli_queries0.004216.033930.0014
Looping result0.00000.146410.0000
Template Total0.00207.610.0020
Template load0.00103.859610.0010
Template processing0.00103.740710.0010
Override
Cache load0.00072.586210.0007
General
dbfile0.00052.046480.0001
String conversion0.00000.053140.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