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 ): ...@@ -311,13 +311,16 @@ 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 type(group_id) is type('a'): # If group_id is not defined, do not use it
# Single group is defined if group_id not in (None, ''):
role_group_dict[group_id] = 1 if type(group_id) is type('a'):
else: # Single group is defined (this is usually for group membership)
# Multiple users defined role_group_dict[group_id] = 1
for user_id in group_id: else:
role_group_dict[user_id] = 1 # 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()) role_group_id_dict[role].extend(role_group_dict.keys())
# Switch index from role to group id # 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