Skip to main content

Show personal bar only to authenticated users.

Project description

The personal bar is hidden for anonymous users

This package was created for the usecase that we have a Plone site where is no user interaction. So we don’t need a login possibility for all users, provided with the personal bar. But if someone is logged in it’s very usefull to have the personal bar. So the personal bar is hidden to anonymous users, but show to authenticated ones.

Tested with Plone 4.0.4.

>>> from os.path import dirname, join
>>> from plone.app.testing import (
...     TEST_USER_NAME,
...     TEST_USER_PASSWORD,
... )
>>> from plone.testing.z2 import Browser
>>> browser = Browser(layer['app'])
>>> browser.handleErrors = False
>>> portal = layer['portal']

As an anonymous user we can’t see the personal bar:

>>> browser.open(portal.absolute_url())
>>> '<a href="http://nohost/plone/@@personal-preferences">' in browser.contents
False
>>> '<a href="http://nohost/plone/dashboard">' in browser.contents
False

But after a login, it’s there:

>>> browser.addHeader('Authorization', 'Basic %s:%s' % (TEST_USER_NAME, TEST_USER_PASSWORD,))
>>> browser.open(portal.absolute_url())
>>> '<a href="http://nohost/plone/@@personal-preferences">' in browser.contents
True
>>> '<a href="http://nohost/plone/dashboard">' in browser.contents
True

Changelog

0.1.1 (2011-04-07)

  • fix repo url [j23d]
  • add tested Plone version to README.txt [j23d]

0.1 (2011-04-07)

  • Initial release [j23d]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for collective.layout.authpersonalbar, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size collective.layout.authpersonalbar-0.1.1-py2.6.egg (12.7 kB) File type Egg Python version 2.6 Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page