Commit f82f2b97 authored by Alexandre Boeglin's avatar Alexandre Boeglin

continue is better than return if we depend on more than one script.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4298 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 38e8e38e
......@@ -256,7 +256,7 @@ class ERP5TypeInformation( FactoryTypeInformation, RoleProviderBase ):
# If we decide in the script that we don't want to update the security for this object,
# we can just have it return None instead of a dict or list of dicts
if category_result is None:
return
continue
if type(category_result) is type({}):
category_result = [category_result]
else:
......@@ -288,25 +288,27 @@ class ERP5TypeInformation( FactoryTypeInformation, RoleProviderBase ):
role_group_dict[group_id] = 1
role_group_id_dict[role].extend(role_group_dict.keys())
#Switch index from role to group id
# Switch index from role to group id
group_id_role_dict = {}
for role, group_list in role_group_id_dict.items():
for group_id in group_list:
if not group_id_role_dict.has_key(group_id):
group_id_role_dict[group_id] = []
group_id_role_dict[group_id].append(role)
# Update role assignments to groups
if ERP5UserManager is not None: # Default implementation
#Clean old group roles
# Clean old group roles
old_group_list = object.get_local_roles()
object.manage_delLocalRoles([x[0] for x in old_group_list])
#Assign new roles
# Assign new roles
for group, role_list in group_id_role_dict.items():
object.manage_addLocalRoles(group, role_list)
else: # NuxUserGroups implementation
#Clean old group roles
# Clean old group roles
old_group_list = object.get_local_group_roles()
object.manage_delLocalGroupRoles([x[0] for x in old_group_list])
#Assign new roles
# Assign new roles
for group, role_list in group_id_role_dict.items():
object.manage_addLocalGroupRoles(group, role_list)
......
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