Commit add6e495 authored by Jean-Paul Smets's avatar Jean-Paul Smets

Ignore empty or None group/user in local role assignment


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5222 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a4dadd75
......@@ -311,13 +311,16 @@ class ERP5TypeInformation( FactoryTypeInformation, RoleProviderBase ):
role_group_dict = {}
for category_dict in value_list:
group_id = group_id_generator(**category_dict)
if type(group_id) is type('a'):
# Single group is defined
role_group_dict[group_id] = 1
else:
# Multiple users defined
for user_id in group_id:
role_group_dict[user_id] = 1
# If group_id is not defined, do not use it
if group_id not in (None, ''):
if type(group_id) is type('a'):
# Single group is defined (this is usually for group membership)
role_group_dict[group_id] = 1
else:
# Multiple groups are defined (this is usually for users)
# but it could be extended to ad hoc groups
for user_id in group_id:
role_group_dict[user_id] = 1
role_group_id_dict[role].extend(role_group_dict.keys())
# Switch index from role to group id
......
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