[Zope] strftime - Unauthorised!

Sion Morris s.morris@bangor.ac.uk
Tue, 10 Jul 2001 16:29:20 +0100


Hi,

Having searched for an answer with Google and zope.nipltd.com I 
finally come to you for help:

Why should this little snippet of Pythonscript code prompt for an 
username and password (even a manager is logged in) and then reject 
it with an error?

apptRec = 
context.ParticipantApptSelectMethod(participant_id=result.participant_id, 
study_id=study_id)
if len(apptRec.dictionaries()):
   linex = linex + ' A ' + apptRec[0].appt_date.strftime('%d\%m\%Y')

The script works ok without a reference to 'strftime'.

Here is the traceback and Zope details

Zope 2.3.2 (source release, python 1.5.2, linux2)


Traceback (innermost last):
   File /opt/zope/lib/python/ZPublisher/Publish.py, line 223, in publish_module
   File /opt/zope/lib/python/ZPublisher/Publish.py, line 187, in publish
   File /opt/zope/lib/python/ZPublisher/Publish.py, line 171, in publish
   File /opt/zope/lib/python/ZPublisher/mapply.py, line 160, in mapply
     (Object: suitableParticipant)
   File /opt/zope/lib/python/ZPublisher/Publish.py, line 112, in call_object
     (Object: suitableParticipant)
   File /opt/zope/lib/python/Shared/DC/Scripts/Bindings.py, line 324, 
in __call__
     (Object: suitableParticipant)
   File /opt/zope/lib/python/Shared/DC/Scripts/Bindings.py, line 354, 
in _bindAndExec
     (Object: suitableParticipant)
   File /opt/zope/lib/python/Products/PythonScripts/PythonScript.py, 
line 336, in _exec
     (Object: suitableParticipant)
     (Info: ({'script': <PythonScript instance at 8778e28>, 'context': 
<Folder instance at 8836d78>, 'container': <Folder instance at 
8836d78>, 'traverse_subpath': []}, ('yes', '2'), {}, None))
   File Script (Python), line 13, in suitableParticipant
   File /opt/zope/lib/python/Products/PythonScripts/Guarded.py, line 
273, in __getattr__
   File /opt/zope/lib/python/Products/PythonScripts/Guarded.py, line 
150, in __careful_getattr__
   File /opt/zope/lib/python/AccessControl/SecurityManager.py, line 
144, in validate
   File /opt/zope/lib/python/AccessControl/ZopeSecurityPolicy.py, line 
168, in validate
Unauthorized: strftime

Regards,

Sion

-- 
Computer Support
Sion Morris
School of Psychology                       Ysgol Seicoleg
University of Wales, Bangor                Prifysgol Cymru Bangor
Tel: 01248 382469
Fax: 01248 382599