[Zope] BeforeDeleteException and FTP "530 Unauthorized" messages

Joseph Kocherhans jkocherhans at mac.com
Tue Mar 30 20:30:00 EST 2004


I've just spent a few hours digging around in ZServer and friends. I 
haven't wrapped my head around everything, but the basic idea I get is 
that if a user is not allowed to delete objects from a container, then 
either an Unauthorized or Forbibben exception is raised (I'm still not 
able to tell which). This is then translated to it's respective code 
(401 or 403) and set as the status of an Response object. Then, in 
FTPServer the 401 or 403 is returned to the ftp client as "530 Unauthorized"

I have a product that is using BeforeDeleteException to veto object 
deletion. I would expect that when I tried to delete the object via FTP 
that the ftp client would get "530 Unauthorized", but it gets nothing 
and the BeforeDeleteException is going uncaught.

It seems to me that in ZServer the http response status is directly tied 
to the exception type (either Unauthorized or Forbidden.) Does anyone 
how I might go about geting the ftp server to return "530 Unauthorized" 
if object deletion is vetoed with BeforeDeleteException? Or more 
specifically how a BeforedDeleteException could change the response 
status to 401 or 403 (which is more appropriate?) Also, is this a bug, 
or is there some reason the BeforeDeleteException goes uncaught?

Any insight would be much appreciated.

Thanks,
joseph




More information about the Zope mailing list