Commit 1a34d528 authored by Chris McDonough's avatar Chris McDonough

Collector 1626: Don't raise Forbidden if we don't know what to do. Instead,...

Collector 1626: Don't raise Forbidden if we don't know what to do.  Instead, riase Unauthorized if _verifyObjectPaste fails in a way that we understand; let all other exceptions bubble to the top.
parent e5518b1a
...@@ -27,6 +27,7 @@ from zExceptions import Unauthorized, NotFound, Forbidden, BadRequest ...@@ -27,6 +27,7 @@ from zExceptions import Unauthorized, NotFound, Forbidden, BadRequest
from zExceptions import MethodNotAllowed from zExceptions import MethodNotAllowed
from common import isDavCollection from common import isDavCollection
from common import Locked, Conflict, PreconditionFailed, UnsupportedMediaType from common import Locked, Conflict, PreconditionFailed, UnsupportedMediaType
from OFS.CopySupport import CopyError
class NullResource(Persistent, Acquisition.Implicit, Resource): class NullResource(Persistent, Acquisition.Implicit, Resource):
"""Null resources are used to handle HTTP method calls on """Null resources are used to handle HTTP method calls on
...@@ -143,10 +144,8 @@ class NullResource(Persistent, Acquisition.Implicit, Resource): ...@@ -143,10 +144,8 @@ class NullResource(Persistent, Acquisition.Implicit, Resource):
# check the clipboard. # check the clipboard.
try: try:
parent._verifyObjectPaste(ob.__of__(parent), 0) parent._verifyObjectPaste(ob.__of__(parent), 0)
except Unauthorized: except CopyError:
raise raise Unauthorized, sys.exc_info()[1]
except:
raise Forbidden, sys.exc_info()[1]
# Delegate actual PUT handling to the new object, # Delegate actual PUT handling to the new object,
# SDS: But just *after* it has been stored. # SDS: But just *after* it has been stored.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment