Commit 72a737aa authored by Jérome Perrin's avatar Jérome Perrin

don't call _aq_dynamic if not needed (although in most of cases it will be needed)


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@38456 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ca9cb0c0
...@@ -114,7 +114,9 @@ class Setter(Method): ...@@ -114,7 +114,9 @@ class Setter(Method):
# security on the class for generated methods. # security on the class for generated methods.
# We explictly call _aq_dynamic to prevent acquiering the attribute # We explictly call _aq_dynamic to prevent acquiering the attribute
# from container # from container
roles = getattr(im_self.__class__, name, im_self._aq_dynamic(name)) roles = getattr(im_self.__class__, name, im_self)
if roles is im_self:
roles = im_self._aq_dynamic(name)
if roles is None: if roles is None:
return rolesForPermissionOn(None, im_self, ('Manager',), return rolesForPermissionOn(None, im_self, ('Manager',),
'_Modify_portal_content_Permission') '_Modify_portal_content_Permission')
...@@ -191,7 +193,9 @@ class Getter(Method): ...@@ -191,7 +193,9 @@ class Getter(Method):
name = '%s__roles__' % ob.__name__ name = '%s__roles__' % ob.__name__
# we explictly call _aq_dynamic to prevent acquiering the attribute # we explictly call _aq_dynamic to prevent acquiering the attribute
# from container # from container
roles = getattr(im_self.__class__, name, im_self._aq_dynamic(name)) roles = getattr(im_self.__class__, name, im_self)
if roles is im_self:
roles = im_self._aq_dynamic(name)
if roles is None: if roles is None:
return rolesForPermissionOn(None, im_self, ('Manager',), return rolesForPermissionOn(None, im_self, ('Manager',),
'_Access_contents_information_Permission') '_Access_contents_information_Permission')
......
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