fetch limitation parameter

Author Message

James Ward

Tuesday 24 January 2006 5:25:55 pm

running ez 3.7.2

Has anyone got a working example of the fetch limitation parameter mentioned in the docs at: http://ez.no/doc/ez_publish/technical_manual/3_6/reference/modules/content/fetch_functions/list

I tried the following to fetch a subnode that the anonymous user can not access:

{def $emptyarray=array()}
{def $objects=fetch(content, list, hash(parent_node_id, $node.node_id, 
                                        limitation, array ( $emptyarray ) ) )}

I'm not sure if this paramter is working yet as the documentation is a little vague. The docs would seem to indicate that I can use this to ignore user permissions and fetch subnodes.

Thanks in advance.

working at www.wardnet.com
blogging at www.jamesward.ca

Kristof Coomans

Tuesday 24 January 2006 11:25:26 pm

Take a look at eZContentObjectTreeNode::createPermissionCheckingSQLString. It gets called with the limitation array you provided, and adds extra SQL conditions according to the entries in the limitation array. An emtpy limitation array should result in no extra conditions, so it disables any policy checking.

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

Ɓukasz Serwatka

Tuesday 24 January 2006 11:47:11 pm

Example which will work is:

{def $objects=fetch(content, list, hash(parent_node_id, $node.node_id, 
                                       limitation, array() ) )}

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

James Ward

Wednesday 25 January 2006 8:50:42 am

Thanks Lukasz,
I had actually tried that way first but thought it was not working. My problem was in my understanding of what you can and can not do with the fetched information. After the object fetch without limitation I was attempting to view the node with the following:

{node_view_gui view=full content_node=$objects[0]}

Which obviously is not allowed, I assume because the fetches within that node view will be restricted by the permisison limitations.

As soon as I used the following I was able to see information within the restricted node:

{attribute_view_gui attribute=$objects[0].data_map.name}

In retrospect this makes complete sense and is a logical way for the limitation parameter to work.

Thanks for all your help.

working at www.wardnet.com
blogging at www.jamesward.ca

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 22:20:46
Script start
Timing: Jan 18 2025 22:20:46
Module start 'layout'
Timing: Jan 18 2025 22:20:46
Module start 'content'
Timing: Jan 18 2025 22:20:47
Module end 'content'
Timing: Jan 18 2025 22:20:47
Script end

Main resources:

Total runtime0.6026 sec
Peak memory usage4,096.0000 KB
Database Queries62

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0057 587.9141152.6250
Module start 'layout' 0.00570.0027 740.539139.4453
Module start 'content' 0.00840.5930 779.9844602.9141
Module end 'content' 0.60140.0011 1,382.898412.1641
Script end 0.6025  1,395.0625 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.5491160.0002
Check MTime0.00130.2216160.0001
Mysql Total
Database connection0.00090.144210.0009
Mysqli_queries0.546690.7057620.0088
Looping result0.00100.1703600.0000
Template Total0.575895.620.2879
Template load0.00210.351220.0011
Template processing0.573795.210720.2869
Template load and register function0.00010.023110.0001
states
state_id_array0.00070.113510.0007
state_identifier_array0.00070.108120.0003
Override
Cache load0.00180.3034270.0001
Sytem overhead
Fetch class attribute can translate value0.00080.126530.0003
Fetch class attribute name0.00110.178070.0002
XML
Image XML parsing0.00140.236830.0005
class_abstraction
Instantiating content class attribute0.00000.002380.0000
General
dbfile0.00100.1648300.0000
String conversion0.00000.001540.0000
Note: percentages do not add up to 100% because some accumulators overlap

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
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 22
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs