Quantcast
Channel: Planet Plone - Where Developers And Integrators Write
Viewing all articles
Browse latest Browse all 3535

Nidelven IT: Automating Plone setups - Faking a Zope user

$
0
0
So I've setup our Plone demo site,

  http://plonehostingdemo.nidelven-it.no

again after a long hiatus. It includes a script to setup Plone instances automatically as users register with their email address.

In that process I discovered that the Plone installation (setup) scripts stopped working properly if an unauthenticated user was running the External Method that sets up the sites (workflowexception, no action for object).

After a little thinking I figured that the problem might be the login status of the user registering as the registration was working fine when being run by the admin (logged-in) user.

So I created this script:

http://pypi.python.org/pypi/Products.FakeZopeUser/

Which overrides the standard security context and enables one to fake a Zope user from an acl_users folder, or simply fake a system user such as system or nobody.

The product won't change the actual logged-in (or anonymous user) for example when looking at the undo tab, but it does the trick for the workflow machinery which accepts whatever user you select or specify when calling FakeZopeUser.FakeUser.

[Update, demo site now works as it should, so try again if it didn't]

Viewing all articles
Browse latest Browse all 3535

Trending Articles