Commit da1a0590 authored by Vincent Pelletier's avatar Vincent Pelletier

Remove Owner key before iterating on the dictionary to avoid testing at each iterration.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19286 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5fbdcc5f
......@@ -146,6 +146,8 @@ class IndexableObjectWrapper(CMFCoreIndexableObjectWrapper):
new_dict[key] = new_list
localroles = new_dict
user_role_list = []
if 'Owner' in localroles:
del localroles['Owner']
for role_list in localroles.values():
user_role_list.extend([role for role in role_list if role not in user_role_list])
# Added for ERP5 project by JP Smets
......@@ -159,8 +161,6 @@ class IndexableObjectWrapper(CMFCoreIndexableObjectWrapper):
view_role_list = [role for role in user_role_list if allowed.has_key(role)]
for user, roles in localroles.items():
for role in roles:
if role == 'Owner':
continue
if allowed.has_key(role):
if withnuxgroups:
allowed[user] = 1
......
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