[Zope-CMF] Puzzling script problem with CMF/Plone
Dieter Maurer
dieter@handshake.de
Thu, 19 Sep 2002 19:52:59 +0200
Braun Brelin writes:
> The problem is that the script works fine
> when I test it in the Zope admin mode. However, when
> I actually run the script as a user on the plone site,
> I get a "Can't find mailhost object" error. If I
> remove the try/except, I get "list index out of range"
>
>
> Obviously the context.superValues() method isn't
> giving
> me back anything, but why does it work under the
> Zope Administrator and not when logged in as a user?
> ...
> mailhost=getattr(context,context.superValues
> ('MailHost')[0].id)
Access to MailHost objects is protected.
This does not explain why "context.superValues('MailHost')" returns
nothing (because it ignores permissions), but access to "id"
or the "getattr" will probably fail with an "Unauthorized" exception.
Try to give the script a "Manager" proxy role and see whether this
changes something.
Dieter