Minor commit related to the last one (uniq roles/privileges)

This commit is contained in:
Miroslav Stampar 2012-12-18 12:47:06 +01:00
parent 699a0f756a
commit eb23b1b1a5

View File

@ -82,8 +82,8 @@ class Enumeration(GenericEnumeration):
if isAdminFromPrivileges(roles):
areAdmins.add(user)
if kb.data.cachedUsersRoles.has_key(user):
kb.data.cachedUsersRoles[user].extend(roles)
if user in kb.data.cachedUsersRoles:
kb.data.cachedUsersRoles[user] = list(roles.union(kb.data.cachedUsersRoles[user]))
else:
kb.data.cachedUsersRoles[user] = list(roles)