Can a class be seen by different users in different ways?

Author Message

PaoloMellerio kk

Friday 23 January 2004 12:34:04 am

Hi,

I've a class (News) with several attributes.I want the anonymous user can see only some of these attribute, while the guests (registerd users) can see all of them; I've thinked to solve the problem using two different sections (Section 1 for the Anonymous User and Section 2 for the Guest User) and showing the class in these sections with two different templates: one with only few attributes and the other with all attributes. I've set the rules for the Guest User in this way:
"content read * "
so he can be see the Class News in every section while the rules for the Anonymous User is:
"content read Class( News ) , Section( Section 1 ) "
The problem is that the class News is hidden while the Anonymous User is browsing the Section 1, while if the registered user is browsing Section 1, the class is correctly shown.
Is there a problem in my rules settings? Or is there another way to solve this problem?

THX in advice.
Paolo Mellerio (Clikka!com)

Paolo Mellerio
http://www.clikka.com

Wenyue Yu

Monday 26 January 2004 8:30:49 am

Hi,

It might be solved by using only one template with checking wheather the user is logged in.

{let current_user=fetch('user','current_user'}
{section show=$current_user.is_logged_in}
show attributes not available for anonymous users here.
{/section}
...
{/let}

Regards,
wenyue

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

Main resources:

Total runtime0.6483 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0060 588.1641152.6563
Module start 'layout' 0.00600.0023 740.820339.4922
Module start 'content' 0.00840.6380 780.3125525.2734
Module end 'content' 0.64640.0019 1,305.58598.1094
Script end 0.6483  1,313.6953 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00360.5501160.0002
Check MTime0.00160.2484160.0001
Mysql Total
Database connection0.00080.120810.0008
Mysqli_queries0.598392.2770540.0111
Looping result0.00050.0807520.0000
Template Total0.620995.820.3105
Template load0.00190.298620.0010
Template processing0.619095.471720.3095
Template load and register function0.00010.018610.0001
states
state_id_array0.00090.138710.0009
state_identifier_array0.00090.134520.0004
Override
Cache load0.00160.2416240.0001
Sytem overhead
Fetch class attribute can translate value0.00220.344920.0011
Fetch class attribute name0.00190.291830.0006
XML
Image XML parsing0.00200.311520.0010
class_abstraction
Instantiating content class attribute0.00000.001030.0000
General
dbfile0.00220.3371160.0001
String conversion0.00000.001440.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
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/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: 15
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs