Commit 9d74a62c authored by Yoshinori Okuji's avatar Yoshinori Okuji

Replace hasattr with getattr.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15675 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b7e74637
......@@ -63,8 +63,9 @@ def getRolesInContext( self, object ):
local[ role ] = 1
# patch by Klaus for LocalRole blocking
if hasattr(object, '_getAcquireLocalRoles'):
if not object._getAcquireLocalRoles():
_getAcquireLocalRoles = getattr(object, '_getAcquireLocalRoles', None)
if _getAcquireLocalRoles is not None:
if not _getAcquireLocalRoles():
break
inner = aq_inner( object )
......@@ -164,8 +165,9 @@ def allowed( self, object, object_roles=None ):
return 0
# patch by Klaus for LocalRole blocking
if hasattr(object, '_getAcquireLocalRoles'):
if not object._getAcquireLocalRoles():
_getAcquireLocalRoles = getattr(object, '_getAcquireLocalRoles', None)
if _getAcquireLocalRoles is not None:
if not _getAcquireLocalRoles():
break
inner = aq_inner( inner_obj )
......
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