Commit 1f20a470 authored by 's avatar

Merged from 2.3. branch

parent aaa1e162
......@@ -84,7 +84,7 @@
##############################################################################
"""Property management"""
__version__='$Revision: 1.34 $'[11:-2]
__version__='$Revision: 1.35 $'[11:-2]
import ExtensionClass, Globals
import ZDOM
......@@ -195,8 +195,8 @@ class PropertyManager(ExtensionClass.Base, ZDOM.ElementWithAttributes):
propertysheets=vps(DefaultPropertySheets)
def valid_property_id(self, id):
if not id or id[:1]=='_' or (' ' in id) \
or hasattr(aq_base(self), id):
if not id or id[:1]=='_' or (id[:3]=='aq_') \
or (' ' in id) or hasattr(aq_base(self), id):
return 0
return 1
......@@ -243,10 +243,6 @@ class PropertyManager(ExtensionClass.Base, ZDOM.ElementWithAttributes):
if not self.valid_property_id(id):
raise 'Bad Request', 'Invalid or duplicate property id'
# Perform additional validation checks for security.
from ObjectManager import checkValidId
checkValidId(self, id)
if type in ('selection', 'multiple selection'):
if not hasattr(self, value):
raise 'Bad Request', 'No select variable %s' % value
......
......@@ -84,7 +84,7 @@
##############################################################################
"""Property sheets"""
__version__='$Revision: 1.63 $'[11:-2]
__version__='$Revision: 1.64 $'[11:-2]
import time, string, App.Management, Globals
from ZPublisher.Converters import type_converters
......@@ -205,12 +205,8 @@ class PropertySheet(Traversable, Persistent, Implicit):
return self.v_self()
def valid_property_id(self, id):
"""Is the given id valid to use as a property id
Note that this method does not consider
factors other than the actual value of the id, such as
whether the given id is already in use."""
if not id or (id[:1]=='_') or (' ' in id):
if not id or id[:1]=='_' or (id[:3]=='aq_') \
or (' ' in id):
return 0
return 1
......@@ -251,10 +247,6 @@ class PropertySheet(Traversable, Persistent, Implicit):
if not self.valid_property_id(id):
raise 'Bad Request', 'Invalid property id, %s.' % id
# Perform additional validation checks for security.
from ObjectManager import checkValidId
checkValidId(self, id)
if not self.property_extensible_schema__():
raise 'Bad Request', (
'Properties cannot be added to this property sheet')
......
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