[Checkins] SVN: z3c.contents/trunk/src/z3c/contents/browser.py
Remove security proxy on item rename
Roger Ineichen
roger at projekt01.ch
Wed Mar 19 09:38:05 EDT 2008
Log message for revision 84781:
Remove security proxy on item rename
This is needed because the IContainerItemRenamer from zope.copypastemove
is not correct registered and allows to rename on proxied items.
We need to fix that later.
Changed:
U z3c.contents/trunk/src/z3c/contents/browser.py
-=-
Modified: z3c.contents/trunk/src/z3c/contents/browser.py
===================================================================
--- z3c.contents/trunk/src/z3c/contents/browser.py 2008-03-19 06:50:16 UTC (rev 84780)
+++ z3c.contents/trunk/src/z3c/contents/browser.py 2008-03-19 13:38:05 UTC (rev 84781)
@@ -25,13 +25,14 @@
from zope.copypastemove.interfaces import IPrincipalClipboard
from zope.copypastemove.interfaces import IObjectCopier, IObjectMover
from zope.copypastemove.interfaces import IContainerItemRenamer
-from zope.app.container.interfaces import IContainerNamesContainer
from zope.exceptions import DuplicationError
from zope.exceptions.interfaces import UserError
+from zope.security.proxy import removeSecurityProxy
from zope.security.interfaces import Unauthorized
from zope.traversing.interfaces import TraversalError
from zope.traversing import api
+from zope.app.container.interfaces import IContainerNamesContainer
from zope.app.container.interfaces import DuplicateIDError
from z3c.form import button
@@ -346,7 +347,8 @@
newName = renameCol.getRenameValue(item)
if newName is not None and oldName != newName:
try:
- renamer = IContainerItemRenamer(self.context)
+ container = removeSecurityProxy(self.context)
+ renamer = IContainerItemRenamer(container)
renamer.renameItem(oldName, newName)
changed = True
except DuplicationError:
More information about the Checkins
mailing list