Commit 950046bc authored by Jean-Paul Smets's avatar Jean-Paul Smets

Speed optimisation for security


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3710 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 65918758
...@@ -140,7 +140,13 @@ class ERP5TypeInformation( FactoryTypeInformation, RoleProviderBase ): ...@@ -140,7 +140,13 @@ class ERP5TypeInformation( FactoryTypeInformation, RoleProviderBase ):
""" """
ob = FactoryTypeInformation.constructInstance(self, container, id, *args, **kw) ob = FactoryTypeInformation.constructInstance(self, container, id, *args, **kw)
# Try to find the local role init script # Only try to find the local role init script
# if some roles are defined
# This is an optimisation to prevent defining local roles on subobjects
# which acquire their security definition from their parent
# The downside of this optimisation is that it is not possible to
# set a local role definition if the local role list is empty
if len(self._roles):
init_role_script = getattr(ob, ERP5TYPE_ROLE_INIT_SCRIPT, None) init_role_script = getattr(ob, ERP5TYPE_ROLE_INIT_SCRIPT, None)
if init_role_script is not None: if init_role_script is not None:
# Retrieve applicable roles # Retrieve applicable roles
......
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