Commit 26e2d0bc authored by Vincent Pelletier's avatar Vincent Pelletier

SQLCatalog: Drop redundant sort & cast.

getLocalRolesGroupIdDict is supposed to return sorted & cast
allowed_roles_and_users value already.
Also, use "x in y" pattern over y.has_key(x) for readability.
parent da29e93c
...@@ -851,11 +851,10 @@ class Catalog(Folder, ...@@ -851,11 +851,10 @@ class Catalog(Folder,
security_uid = None security_uid = None
for key in wrapped_object.getLocalRolesGroupIdDict().iteritems(): for key in wrapped_object.getLocalRolesGroupIdDict().iteritems():
local_roles_group_id, allowed_roles_and_users = key local_roles_group_id, allowed_roles_and_users = key
allowed_roles_and_users = tuple(sorted(allowed_roles_and_users)) if key in self.security_uid_dict:
if self.security_uid_dict.has_key(key):
local_roles_group_id_to_security_uid_mapping[local_roles_group_id] \ local_roles_group_id_to_security_uid_mapping[local_roles_group_id] \
= self.security_uid_dict[key] = self.security_uid_dict[key]
elif self.security_uid_dict.has_key(allowed_roles_and_users)\ elif allowed_roles_and_users in self.security_uid_dict \
and not local_roles_group_id: and not local_roles_group_id:
# This key is present in security_uid_dict without # This key is present in security_uid_dict without
# local_roles_group_id, it has been inserted before # local_roles_group_id, it has been inserted before
......
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