Monday, February 11, 2008

iw.rejectanonymous: private site with plone 3.0

We have made a small package to provide the functionality described in my previous post. It is named "iw.rejectanonymous".

Quick recipe to use it from an integration product (i.e a product responsible of setting up a plone site for your particular environment/customer/...):

  • Add in configure.zcml:
    <include package="iw.rejectanonymous" />

  • Add python code to activate it for your site. This is probably done in a function called by generic setup, this is often located in setuphandlers.py:
    from zope.interface import alsoProvides
    from iw.rejectanonymous import IPrivateSite

    def setupPortal(portal):
    if not IPrivateSite.providedBy(portal):
    alsoProvides(portal, IPrivateSite)
The second step can be done through the ZMI with the "Interfaces" tab.