Commit 9683458b authored by Jean-Paul Smets's avatar Jean-Paul Smets

InitialiseClass implemented on prop_holder for security....

InitialiseClass implemented on prop_holder for security. Base.aq_related_generated = 1 moves in safe place


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3315 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8550d3f3
...@@ -177,10 +177,7 @@ def initializePortalTypeDynamicProperties(self, klass, ptype): ...@@ -177,10 +177,7 @@ def initializePortalTypeDynamicProperties(self, klass, ptype):
prop_holder._properties = prop_list prop_holder._properties = prop_list
prop_holder._categories = cat_list prop_holder._categories = cat_list
prop_holder._constraints = constraint_list prop_holder._constraints = constraint_list
if hasattr(klass, 'security'): prop_holder.security = ClassSecurityInfo() # We create a new security info object
prop_holder.security = klass.security # Is this OK for security XXX ?
else:
prop_holder.security = ClassSecurityInfo() # Is this OK for security XXX ?
from Utils import initializeDefaultProperties from Utils import initializeDefaultProperties
initializeDefaultProperties([prop_holder], object=self) initializeDefaultProperties([prop_holder], object=self)
#LOG('initializeDefaultProperties: %s' % ptype, 0, str(prop_holder.__dict__)) #LOG('initializeDefaultProperties: %s' % ptype, 0, str(prop_holder.__dict__))
...@@ -254,9 +251,10 @@ def initializePortalTypeDynamicProperties(self, klass, ptype): ...@@ -254,9 +251,10 @@ def initializePortalTypeDynamicProperties(self, klass, ptype):
if callable(method): if callable(method):
if not isinstance(method, WorkflowMethod): if not isinstance(method, WorkflowMethod):
method = WorkflowMethod(method, method_id) method = WorkflowMethod(method, method_id)
setattr(prop_holder, method_id, method) setattr(prop_holder, method_id, method)
# We can now associate it # We can now associate it after initialising security
InitializeClass(prop_holder)
Base.aq_portal_type[ptype] = prop_holder Base.aq_portal_type[ptype] = prop_holder
...@@ -363,7 +361,6 @@ class Base( CopyContainer, PortalContent, ActiveObject, ERP5PropertyManager ): ...@@ -363,7 +361,6 @@ class Base( CopyContainer, PortalContent, ActiveObject, ERP5PropertyManager ):
# Generate Related Accessors # Generate Related Accessors
if not Base.aq_related_generated: if not Base.aq_related_generated:
from Utils import createRelatedValueAccessors from Utils import createRelatedValueAccessors
Base.aq_related_generated = 1
generated = 1 generated = 1
portal_categories = getToolByName(self, 'portal_categories', None) portal_categories = getToolByName(self, 'portal_categories', None)
generated_bid = {} generated_bid = {}
...@@ -373,7 +370,8 @@ class Base( CopyContainer, PortalContent, ActiveObject, ERP5PropertyManager ): ...@@ -373,7 +370,8 @@ class Base( CopyContainer, PortalContent, ActiveObject, ERP5PropertyManager ):
if bid not in generated_bid: if bid not in generated_bid:
#LOG( "Create createRelatedValueAccessors %s" % bid,0,'') #LOG( "Create createRelatedValueAccessors %s" % bid,0,'')
createRelatedValueAccessors(Base, bid) createRelatedValueAccessors(Base, bid)
generated_bid[bid] = 1 generated_bid[bid] = 1
Base.aq_related_generated = 1
# Always try to return something after generation # Always try to return something after generation
if generated: if generated:
......
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