Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/sureshvv/AccessControl in…
Browse files Browse the repository at this point in the history
…to sureshvv-master
  • Loading branch information
tseaver committed Apr 24, 2013
2 parents e025a00 + 1401dd7 commit c744aa5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Changelog
3.0.7 (unreleased)
------------------

- Fix a bug causing an infinite loop when looking up local roles in acquisition chain


3.0.6 (2012-10-31)
------------------
Expand Down
4 changes: 4 additions & 0 deletions src/AccessControl/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ def allowed(self, object, object_roles=None):
# we can incur only the overhead required to find a match.
inner_obj = getattr(object, 'aq_inner', object)
userid = self.getId()
parents = set()
while 1:
local_roles = getattr(inner_obj, '__ac_local_roles__', None)
if local_roles:
Expand All @@ -226,6 +227,9 @@ def allowed(self, object, object_roles=None):
inner = getattr(inner_obj, 'aq_inner', inner_obj)
parent = getattr(inner, '__parent__', None)
if parent is not None:
if parent in parents:
break
parents.add(parent)
inner_obj = parent
continue
if hasattr(inner_obj, 'im_self'):
Expand Down

0 comments on commit c744aa5

Please sign in to comment.