[CMF-checkins] CVS: Products/CMFCore - PortalFolder.py:1.76
Yvo Schubbe
y.2004_ at wcm-solutions.de
Fri Sep 24 09:29:30 EDT 2004
Update of /cvs-repository/Products/CMFCore
In directory cvs.zope.org:/tmp/cvs-serv28666/CMFCore
Modified Files:
PortalFolder.py
Log Message:
- allowed to overwrite content items of the portal root
=== Products/CMFCore/PortalFolder.py 1.75 => 1.76 ===
--- Products/CMFCore/PortalFolder.py:1.75 Sun Sep 19 09:15:24 2004
+++ Products/CMFCore/PortalFolder.py Fri Sep 24 09:29:30 2004
@@ -374,9 +374,9 @@
try:
self._checkId(id)
except BadRequest:
- return 0
+ return False
else:
- return 1
+ return True
def MKCOL_handler(self,id,REQUEST=None,RESPONSE=None):
"""
@@ -387,20 +387,25 @@
def _checkId(self, id, allow_dup=0):
PortalFolder.inheritedAttribute('_checkId')(self, id, allow_dup)
- # This method prevents people other than the portal manager
- # from overriding skinned names.
- if not allow_dup:
- if not getSecurityManager().checkPermission(ManagePortal, self):
- ob = self
- while ob is not None and not getattr(ob, '_isPortalRoot', 0):
- ob = aq_parent(aq_inner(ob))
- if ob is not None:
- # If the portal root has an object by this name,
- # don't allow an override.
- # FIXME: needed to allow index_html for join code
- if hasattr(ob, id) and id != 'index_html':
- raise BadRequest('The id "%s" is reserved.' % id)
- # Otherwise we're ok.
+ if allow_dup:
+ return
+
+ # FIXME: needed to allow index_html for join code
+ if id == 'index_html':
+ return
+
+ # This code prevents people other than the portal manager from
+ # overriding skinned names and tools.
+ if not getSecurityManager().checkPermission(ManagePortal, self):
+ ob = self
+ while ob is not None and not getattr(ob, '_isPortalRoot', False):
+ ob = aq_parent( aq_inner(ob) )
+ if ob is not None:
+ # If the portal root has a non-contentish object by this name,
+ # don't allow an override.
+ if hasattr(ob, id) and id not in ob.contentIds():
+ raise BadRequest('The id "%s" is reserved.' % id)
+ # Otherwise we're ok.
def _verifyObjectPaste(self, object, validate_src=1):
# This assists the version in OFS.CopySupport.
More information about the CMF-checkins
mailing list