Skip to content
This repository has been archived by the owner on Dec 17, 2020. It is now read-only.

Commit

Permalink
Remove security proxy on item rename
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
projekt01 committed Mar 19, 2008
1 parent 67f6c15 commit 21d472b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/z3c/contents/browser.py
Expand Up @@ -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
Expand Down Expand Up @@ -346,7 +347,8 @@ def handlerRename(self, action):
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:
Expand Down

0 comments on commit 21d472b

Please sign in to comment.