Fetch all classes a user can read

Author Message

H-Works Agency

Wednesday 13 July 2011 10:40:56 am

Hi everybody,

How is it possible to simply retrieve a list of all classes a user can read ?

  • In fact there is no "can_read" properties on a class object
  • You have the great "can_instantiate_class_list" method but its for creation not for reading

Should we write a new function of is there a specific method.

My final interest is to be able to fetch all readable classes for current user without having to feed the class identifier to a "canRead" function.

EZP is Great

André R.

Thursday 14 July 2011 1:05:01 pm

It's no such function I think, and it will have to be placement specific right?

What is the use case? Usually users are more interested in what content they can read, and that is something that comes out of the box in many ways. 

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

H-Works Agency

Friday 15 July 2011 10:58:43 am

Ok thank you i will create my own function...in fact i need to know what classes a user can read - due to policies - under a certain node.

EZP is Great

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 17 2025 22:58:40
Script start
Timing: Jan 17 2025 22:58:40
Module start 'layout'
Timing: Jan 17 2025 22:58:40
Module start 'content'
Timing: Jan 17 2025 22:58:40
Module end 'content'
Timing: Jan 17 2025 22:58:40
Script end

Main resources:

Total runtime0.6856 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0053 587.9219152.6250
Module start 'layout' 0.00530.0025 740.546939.4688
Module start 'content' 0.00780.6764 780.0156541.4844
Module end 'content' 0.68420.0013 1,321.500012.1563
Script end 0.6856  1,333.6563 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00300.4419160.0002
Check MTime0.00120.1704160.0001
Mysql Total
Database connection0.00120.172010.0012
Mysqli_queries0.635192.6386570.0111
Looping result0.00050.0689550.0000
Template Total0.653495.320.3267
Template load0.00210.300220.0010
Template processing0.651395.002320.3257
Template load and register function0.00010.014310.0001
states
state_id_array0.00080.119810.0008
state_identifier_array0.00080.116320.0004
Override
Cache load0.00170.2495180.0001
Sytem overhead
Fetch class attribute can translate value0.00080.121520.0004
Fetch class attribute name0.00230.333150.0005
XML
Image XML parsing0.00110.153620.0005
class_abstraction
Instantiating content class attribute0.00000.001660.0000
General
dbfile0.00430.6234240.0002
String conversion0.00000.001040.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
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
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/li.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/li.tplEdit templateOverride template
1content/datatype/view/ezxmltags/ul.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/ul.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 14
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs