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,7 +158,9 @@ class IndexableObjectWrapper(object):
group_allowed_set = allowed_by_local_roles_group_id[group]
except KeyError:
allowed_by_local_roles_group_id[group] = group_allowed_set = set()
group_allowed_set.update((prefix, '%s:%s' % (prefix, role)))
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)))
# sort `allowed` principals
sorted_allowed_by_local_roles_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