Ticket #5542 (closed Bug: fixed)
getInheritedLocalRoles in PloneTool fails with "AttributeError: acl_users"
| Reported by: | partecs | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 2.5.1 |
| Component: | Infrastructure | Keywords: | PloneTool |
| Cc: |
Description (last modified by wichert) (diff)
I have a catalog index which calls computeRoleMap(). This in turn calls getInheriredLocalRoles() which fails on the following line:
if portal != here:
parent = here.aq_parent
while cont:
!!!=> userroles = parent.acl_users.getLocalRolesForDisplay(parent)
for user, roles, role_type, name in userroles:
# Find user in result
Seems that parent has lost its acquisition underwear somewhere!
So I made a small change:
if portal != here:
parent = here.aq_parent
while cont:
+++ FIX if not getattr(parent, 'acl_users', None):
+++ FIX break
userroles = parent.acl_users.getLocalRolesForDisplay(parent)
for user, roles, role_type, name in userroles:
# Find user in result
Now all is well!
Change History
Note: See
TracTickets for help on using
tickets.

Sorry... I should have done a page preview:
I have a catalog index which calls computeRoleMap(). This in turn calls getInheriredLocalRoles() which fails on the following line:
if portal != here: parent = here.aq_parent while cont: !!!=> userroles = parent.acl_users.getLocalRolesForDisplay(parent) for user, roles, role_type, name in userroles: # Find user in resultSeems that parent has lost its acquisition underwear somewhere!
So I made a small change:
if portal != here: parent = here.aq_parent while cont: +++ FIX if not getattr(parent, 'acl_users', None): +++ FIX break userroles = parent.acl_users.getLocalRolesForDisplay(parent) for user, roles, role_type, name in userroles: # Find user in resultNow all is well!