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