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,11 +311,14 @@ class ERP5TypeInformation( FactoryTypeInformation, RoleProviderBase ): ...@@ -311,11 +311,14 @@ class ERP5TypeInformation( FactoryTypeInformation, RoleProviderBase ):
role_group_dict = {} role_group_dict = {}
for category_dict in value_list: for category_dict in value_list:
group_id = group_id_generator(**category_dict) group_id = group_id_generator(**category_dict)
# If group_id is not defined, do not use it
if group_id not in (None, ''):
if type(group_id) is type('a'): if type(group_id) is type('a'):
# Single group is defined # Single group is defined (this is usually for group membership)
role_group_dict[group_id] = 1 role_group_dict[group_id] = 1
else: else:
# Multiple users defined # Multiple groups are defined (this is usually for users)
# but it could be extended to ad hoc groups
for user_id in group_id: for user_id in group_id:
role_group_dict[user_id] = 1 role_group_dict[user_id] = 1
role_group_id_dict[role].extend(role_group_dict.keys()) role_group_id_dict[role].extend(role_group_dict.keys())
......
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