[Plone-UI] tabs depending on authentication

espen espen at medialog.no
Wed Oct 22 11:12:58 UTC 2014


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

21. okt. 2014 kl. 16:24 skrev Michele Sanguillon [via Plone] <ml-node+s293351n7572660h13 at n2.nabble.com>:

> 
> 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:
https://github.com/espenmn/medialog.simpleslider/blob/master/src/medialog/simpleslider/profiles/default/actions.xml
(the condition)

which gets it from here:
https://github.com/espenmn/medialog.simpleslider/blob/master/src/medialog/simpleslider/browser/utils.py#L61
(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 
> [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 ml-node+s293351n293357h20 at n2.nabble.com 
> To unsubscribe from Plone, click here.
> NAML





--
View this message in context: http://plone.293351.n2.nabble.com/tabs-depending-on-authentication-tp7572660p7572671.html
Sent from the User Interface & Design mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.plone.org/pipermail/plone-ui/attachments/20141022/3f1e1b0c/attachment.html>


More information about the UI mailing list