[Zope-Checkins] CVS: Zope/lib/python/webdav - NullResource.py:1.32.16.1 Resource.py:1.47.24.1

Jim Fulton jim@zope.com
Mon, 15 Oct 2001 17:22:46 -0400


Update of /cvs-repository/Zope/lib/python/webdav
In directory cvs.zope.org:/tmp/cvs-serv21338/lib/python/webdav

Modified Files:
      Tag: cAccessControl-review-branch
	NullResource.py Resource.py 
Log Message:
Checking in changes made during review of new cAccessControl
implementation. The changes fall into two classes:

- Changes made to C code

- Switching to use of Unauthorized class exception.
  This one is especially significant. :)


=== Zope/lib/python/webdav/NullResource.py 1.32 => 1.32.16.1 ===
 from WriteLockInterface import WriteLockInterface
 import OFS.SimpleItem
+from zExceptions import Unauthorized
 
 class NullResource(Persistent, Acquisition.Implicit, Resource):
     """Null resources are used to handle HTTP method calls on
@@ -179,8 +180,8 @@
         # check the clipboard.
         try:
             parent._verifyObjectPaste(ob.__of__(parent), 0)
-        except 'Unauthorized':
-            raise 'Unauthorized', sys.exc_info()[1]
+        except Unauthorized:
+            raise
         except:
             raise 'Forbidden', sys.exc_info()[1]
 
@@ -429,8 +430,8 @@
         # Verify that the user can create this type of object
         try:
             parent._verifyObjectPaste(ob.__of__(parent), 0)
-        except 'Unauthorized':
-            raise 'Unauthorized', sys.exc_info()[1]
+        except Unauthorized:
+            raise
         except:
             raise 'Forbidden', sys.exc_info()[1]
 


=== Zope/lib/python/webdav/Resource.py 1.47 => 1.47.24.1 ===
 import Globals, time
 from ZPublisher.HTTPRangeSupport import HTTPRangeInterface
+from zExceptions import Unauthorized
 
 class Resource(ExtensionClass.Base, Lockable.LockableItem):
     """The Resource mixin class provides basic WebDAV support for
@@ -155,7 +156,7 @@
                                                      method)
             except: pass
 
-        raise 'Unauthorized', msg
+        raise Unauthorized, msg
 
     def dav__simpleifhandler(self, request, response, method='PUT',
                              col=0, url=None, refresh=0):
@@ -394,8 +395,8 @@
         try: parent._checkId(name, allow_dup=1)
         except: raise 'Forbidden', sys.exc_info()[1]
         try: parent._verifyObjectPaste(self)
-        except 'Unauthorized':
-            raise 'Unauthorized', sys.exc_info()[1]
+        except Unauthorized:
+            raise
         except: raise 'Forbidden', sys.exc_info()[1]
 
         # Now check locks.  The If header on a copy only cares about the
@@ -483,8 +484,7 @@
         except:
             raise 'Forbidden', sys.exc_info()[1]
         try: parent._verifyObjectPaste(self)
-        except 'Unauthorized':
-            raise 'Unauthorized', sys.exc_info()[1]
+        except Unauthorized: raise
         except: raise 'Forbidden', sys.exc_info()[1]
 
         # Now check locks.  Since we're affecting the resource that we're