Forums / Developer / Content type and rights

Content type and rights

Author Message

Maxime Thomas

Thursday 29 July 2010 2:58:12 am

Hi all,

I have to develop a feature and I have really no idea on how to proceed, maybe you could help. Here's the need of my customer :

An article page is a content made of around 40 attributes (Text line, Rich text, Images and so on).

In this content type, my customer would like to have the following features :

- Being able to edit a "Paragraph" sub content inside the edit form of the Article one. A "Paragraph" is a content with 20 attributes.

- Being able to set up a limitation by attributes. E.g. Contributors A can modify attributes 1 to 10 and Contributors B can modify attributes 11 to 40.

Other points :

- The article has to contain everything (one interface and one page), Ajax is possible but no redirect or publish in three steps.

- Everything has to be versionnable : Article AND Paragraph.

- The version of eZ used is 4.3.

Thank you for any response.

Max

Maxime Thomas
maxime.thomas@wascou.org | www.wascou.org | http://twitter.com/wascou

Company Blog : http://www.wascou.org/eng/Company/Blog
Technical Blog : http://share.ez.no/blogs/maxime-thomas

Thiago Campos Viana

Thursday 29 July 2010 4:33:30 am

The fastest, and non-secure, solution is to create an override of the edit template and make some fields hidden to a group of users, but it could be bypassed with firebug.

Solution b is create an override of the edit template, make some fields hidden to a group of users, change the post action to a module you will create, this module will control the update of the object.

eZ Publish Certified Developer: http://auth.ez.no/certification/verify/376924

Twitter: http://twitter.com/tcv_br

gilles guirand

Monday 02 August 2010 5:25:21 am

Create 2 classes :

  • Article
  • Paragraph

And store your content like this :

Article1

  • Paragraph1
  • Paragraph2
  • Paragraph3

Set your rights & policies (for each content class)

Create an AJAX interface to add paragraph (like an AJAX comment system, like on my gandbox's blog AJAX comment system)

--
Gilles Guirand
eZ Community Board Member
http://twitter.com/gandbox
http://www.gandbox.fr

eZ debug

Timing: Jan 17 2025 23:35:52
Script start
Timing: Jan 17 2025 23:35:52
Module start 'content'
Timing: Jan 17 2025 23:35:53
Module end 'content'
Timing: Jan 17 2025 23:35:53
Script end

Main resources:

Total runtime0.9563 sec
Peak memory usage4,096.0000 KB
Database Queries196

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0054 588.8203180.8438
Module start 'content' 0.00540.7985 769.6641603.7031
Module end 'content' 0.80390.1524 1,373.3672336.7578
Script end 0.9562  1,710.1250 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00410.4327210.0002
Check MTime0.00140.1459210.0001
Mysql Total
Database connection0.00070.071110.0007
Mysqli_queries0.877191.71721960.0045
Looping result0.00220.23151940.0000
Template Total0.927196.920.4635
Template load0.00190.202220.0010
Template processing0.925196.741220.4626
Template load and register function0.00010.009910.0001
states
state_id_array0.00120.122210.0012
state_identifier_array0.00080.087020.0004
Override
Cache load0.00170.1800360.0000
Sytem overhead
Fetch class attribute can translate value0.00150.155040.0004
Fetch class attribute name0.00130.134060.0002
XML
Image XML parsing0.00350.369040.0009
class_abstraction
Instantiating content class attribute0.00000.002760.0000
General
dbfile0.00460.4830400.0001
String conversion0.00000.000730.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/strong.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/strong.tplEdit templateOverride template
2content/datatype/view/ezxmltags/li.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/li.tplEdit templateOverride template
2content/datatype/view/ezxmltags/ul.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/ul.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 19
 Number of unique templates used: 8

Time used to render debug report: 0.0002 secs