Commit dcaabdfb authored by Ivan Tyagov's avatar Ivan Tyagov

Add only if not already added to optimized_role_set to avoid polluting indexation table.

parent a137c801
...@@ -158,6 +158,8 @@ class IndexableObjectWrapper(object): ...@@ -158,6 +158,8 @@ class IndexableObjectWrapper(object):
group_allowed_set = allowed_by_local_roles_group_id[group] group_allowed_set = allowed_by_local_roles_group_id[group]
except KeyError: except KeyError:
allowed_by_local_roles_group_id[group] = group_allowed_set = set() allowed_by_local_roles_group_id[group] = group_allowed_set = set()
if (user, role) not in optimized_role_set:
# add only if not already added to optimized_role_set to avoid polluting indexation table
group_allowed_set.update((prefix, '%s:%s' % (prefix, role))) group_allowed_set.update((prefix, '%s:%s' % (prefix, role)))
# sort `allowed` principals # sort `allowed` principals
......
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