Commit 36ec4a21 authored by Jérome Perrin's avatar Jérome Perrin

BUG FIX : call assignRoleToSecurityGroup even with bypass_init_script;

add a comment on how bypass_init_script must be refactored.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4460 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3b2df02b
...@@ -196,9 +196,6 @@ class ERP5TypeInformation( FactoryTypeInformation, RoleProviderBase ): ...@@ -196,9 +196,6 @@ class ERP5TypeInformation( FactoryTypeInformation, RoleProviderBase ):
self._finishConstruction(ob) self._finishConstruction(ob)
if bypass_init_script :
return ob
# Only try to assign roles to secutiry groups if some roles are defined # Only try to assign roles to secutiry groups if some roles are defined
# This is an optimisation to prevent defining local roles on subobjects # This is an optimisation to prevent defining local roles on subobjects
# which acquire their security definition from their parent # which acquire their security definition from their parent
...@@ -207,7 +204,11 @@ class ERP5TypeInformation( FactoryTypeInformation, RoleProviderBase ): ...@@ -207,7 +204,11 @@ class ERP5TypeInformation( FactoryTypeInformation, RoleProviderBase ):
if len(self._roles): if len(self._roles):
self.assignRoleToSecurityGroup(ob) self.assignRoleToSecurityGroup(ob)
if self.init_script: # TODO: bypass_init_script must be passed as an argument
# to the init_script, and the init_script must always be called;
# so that user can decide what init should be done when this is
# created by DeliveryBuilder.
if self.init_script and not bypass_init_script:
# Acquire the init script in the context of this object # Acquire the init script in the context of this object
init_script = getattr(ob, self.init_script) init_script = getattr(ob, self.init_script)
init_script(*args, **kw) init_script(*args, **kw)
......
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