tabs depending on authentication

classic Classic list List threaded Threaded
2 messages Options
Michele Sanguillon Michele Sanguillon
Reply | Threaded
Open this post in threaded view
|

tabs depending on authentication


Hello,

I installed a Plone 4.2 website and I woulk like it has the same look  
than my old Plone 3.x one.
In this website, I would like to have portal tabs for anonymous users  
of my website and additional portal tabs for authenticated users.
So as on my old website, I add CMF actions in the Site Setup -> ZMI ->  
portal_actions -> portal_tabs with a condition expression :
ID : InstallationSFTP
Title:        Installation / SFTP
I18n Domaine: plone
URL:          string:$portal_url/DBPollux/SetUpDBPolluxSFTPMain
Condition:    
python:portal.portal_membership.getAuthenticatedMember().has_role('Manager')

My problem is that the condition is only evaluated when I start plone  
and not when somebody logs in or out.

Can somebody help me ?

Thanks in advance,

Michele
--
Michèle Sanguillon
Laboratoire Univers et Particules de Montpellier
Université Montpellier II - Place E. Bataillon - Bât. 13 - CC 072
34095 Montpellier Cedex
Tel : +33 (0)4 67 14 93 59 - Fax : +33 (0)4 67 14 41 90


_______________________________________________
UI mailing list
[hidden email]
https://lists.plone.org/mailman/listinfo/plone-ui
espen espen
Reply | Threaded
Open this post in threaded view
|

Re: tabs depending on authentication

Hi
(I dont know much about this, but since noone else has answered)

21. okt. 2014 kl. 16:24 skrev Michele Sanguillon [via Plone] <[hidden email]>:


Hello,

I installed a Plone 4.2 website and I woulk like it has the same look  
than my old Plone 3.x one.
In this website, I would like to have portal tabs for anonymous users  
of my website and additional portal tabs for authenticated users.
So as on my old website, I add CMF actions in the Site Setup -> ZMI ->  
portal_actions -> portal_tabs with a condition expression :
ID : InstallationSFTP
Title:        Installation / SFTP
I18n Domaine: plone
URL:          string:$portal_url/DBPollux/SetUpDBPolluxSFTPMain
Condition:    
python:portal.portal_membership.getAuthenticatedMember().has_role('Manager') 

My problem is that the condition is only evaluated when I start plone  
and not when somebody logs in or out.

Are you sure about that (try with if user is Anon to check)
Could it be that the user does not have manager roles to that part of the site?


Can somebody help me ?

Maybe you could write a helper browser view to return the permission?

If it could be of any help, I do something similar here:
(the condition)

which gets it from here:
(so line 62 in your case would be: 

return portal.portal_membership.getAuthenticatedMember().has_role(‘Manager')

Espen

Thanks in advance,

Michele
--
Michèle Sanguillon
Laboratoire Univers et Particules de Montpellier
Université Montpellier II - Place E. Bataillon - Bât. 13 - CC 072
34095 Montpellier Cedex
Tel : +33 (0)4 67 14 93 59 - Fax : +33 (0)4 67 14 41 90


_______________________________________________
UI mailing list
<a href="x-msg://31/user/SendEmail.jtp?type=node&amp;node=7572660&amp;i=0" target="_top" rel="nofollow" link="external">[hidden email]
https://lists.plone.org/mailman/listinfo/plone-ui



If you reply to this email, your message will be added to the discussion below:
http://plone.293351.n2.nabble.com/tabs-depending-on-authentication-tp7572660.html
To start a new topic under User Interface & Design, email [hidden email]
To unsubscribe from Plone, click here.
NAML