Forums / General / Can a class be seen by different users in different ways?

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

eZ debug

Timing: Jan 18 2025 16:07:33
Script start
Timing: Jan 18 2025 16:07:33
Module start 'content'
Timing: Jan 18 2025 16:07:33
Module end 'content'
Timing: Jan 18 2025 16:07:33
Script end

Main resources:

Total runtime0.8399 sec
Peak memory usage4,096.0000 KB
Database Queries191

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0069 589.0625180.8047
Module start 'content' 0.00690.7001 769.8672530.3828
Module end 'content' 0.70700.1329 1,300.2500332.7344
Script end 0.8399  1,632.9844 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00400.4802210.0002
Check MTime0.00150.1827210.0001
Mysql Total
Database connection0.00070.082110.0007
Mysqli_queries0.779492.79641910.0041
Looping result0.00160.19561890.0000
Template Total0.813696.920.4068
Template load0.00210.249420.0010
Template processing0.811596.616920.4058
Template load and register function0.00010.012610.0001
states
state_id_array0.00070.084410.0007
state_identifier_array0.00090.110220.0005
Override
Cache load0.00170.2025240.0001
Sytem overhead
Fetch class attribute can translate value0.00100.118130.0003
Fetch class attribute name0.00130.158630.0004
XML
Image XML parsing0.00090.103830.0003
class_abstraction
Instantiating content class attribute0.00000.000730.0000
General
dbfile0.00390.4693270.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
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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 15
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs