bug fix for checking parents
git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@2807 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
parent
d9fe18cdc1
commit
6436f3f401
1 changed files with 4 additions and 2 deletions
|
@ -64,7 +64,8 @@ class LoopsSecurityPolicy(ZopeSecurityPolicy):
|
||||||
for p in self.getParents(obj, checked):
|
for p in self.getParents(obj, checked):
|
||||||
# TODO: care for correct combination if there is more than
|
# TODO: care for correct combination if there is more than
|
||||||
# one parent
|
# one parent
|
||||||
roles.update(self.cached_principal_roles(p, principal))
|
if p is not None:
|
||||||
|
roles.update(self.cached_principal_roles(p, principal, checked))
|
||||||
prinrole = IPrincipalRoleMap(obj, None)
|
prinrole = IPrincipalRoleMap(obj, None)
|
||||||
if prinrole:
|
if prinrole:
|
||||||
roles = roles.copy()
|
roles = roles.copy()
|
||||||
|
@ -76,7 +77,8 @@ class LoopsSecurityPolicy(ZopeSecurityPolicy):
|
||||||
|
|
||||||
def getParents(self, obj, checked):
|
def getParents(self, obj, checked):
|
||||||
if obj in checked: # cycle - leave the concept map
|
if obj in checked: # cycle - leave the concept map
|
||||||
return [getattr(obj, '__parent__', None)]
|
parent = getattr(obj, '__parent__', None)
|
||||||
|
return [parent]
|
||||||
# keep concept parents in cache
|
# keep concept parents in cache
|
||||||
cache = self.cache(obj)
|
cache = self.cache(obj)
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Add table
Reference in a new issue