diff --git a/product/ERP5Catalog/CatalogTool.py b/product/ERP5Catalog/CatalogTool.py index 765129f2e937753f23d599477dca72e2422c24f3..efeb8d33ef61b78731488aedabffe36f7f8de425 100644 --- a/product/ERP5Catalog/CatalogTool.py +++ b/product/ERP5Catalog/CatalogTool.py @@ -150,8 +150,9 @@ class IndexableObjectWrapper(object): # If not, continue to index it in roles_and_users table. if (user, role) not in optimized_role_set: user_role_dict[role] = user # Only add to user_role_dict if not in optimized_role_set (double check) - else: + elif not (role in role_dict): # add here local roles which are not part of optimized ones + # and at the same time not a special ones like Owner if (user, role) not in optimized_role_set: user_group = '%s:%s' % (prefix, role) if prefix not in allowed_role_set: diff --git a/product/ERP5Security/tests/testERP5Security.py b/product/ERP5Security/tests/testERP5Security.py index 844150dadadc48df1696fa929a75bbd9378e0dd5..e91877539d27d5ff3968b91c2dac69ce918a87b1 100644 --- a/product/ERP5Security/tests/testERP5Security.py +++ b/product/ERP5Security/tests/testERP5Security.py @@ -585,8 +585,8 @@ class TestLocalRoleManagement(ERP5TypeTestCase): obj = self._makeOne() self.assertEqual(['Assignor'], obj.__ac_local_roles__.get('F1_G1_S1')) self.assertTrue('Assignor' in user.getRolesInContext(obj)) - self.assertEqual(('Alternate',), - obj.__ac_local_roles_group_id_dict__.get('F1_G1_S1')) + self.assertEqual(('F1_G1_S1',), + obj.__ac_local_roles_group_id_dict__.get('Alternate')) self.abort()