Commit 40735a80 authored by Sebastien Robin's avatar Sebastien Robin

fixed bug found thanks to unit test


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3404 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 86a7c908
...@@ -266,8 +266,7 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject): ...@@ -266,8 +266,7 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
when you list up documents. when you list up documents.
""" """
user = _getAuthenticatedUser(self) user = _getAuthenticatedUser(self)
user_and_group_list = self._listAllowedRolesAndUsers(user) allowedRolesAndUsers = self._listAllowedRolesAndUsers(user)
allowedRolesAndUsers = []
# Patch for ERP5 by JP Smets in order # Patch for ERP5 by JP Smets in order
# to implement worklists and search of local roles # to implement worklists and search of local roles
...@@ -275,13 +274,15 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject): ...@@ -275,13 +274,15 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
# Only consider local_roles if it is not empty # Only consider local_roles if it is not empty
if kw['local_roles'] != '' and kw['local_roles'] != [] and kw['local_roles'] is not None: if kw['local_roles'] != '' and kw['local_roles'] != [] and kw['local_roles'] is not None:
local_roles = kw['local_roles'] local_roles = kw['local_roles']
new_allowedRolesAndUsers = []
# Turn it into a list if necessary according to ';' separator # Turn it into a list if necessary according to ';' separator
if type(local_roles) == type('a'): if type(local_roles) == type('a'):
local_roles = local_roles.split(';') local_roles = local_roles.split(';')
# Local roles now has precedence (since it comes from a WorkList) # Local roles now has precedence (since it comes from a WorkList)
for user_or_group in user_and_group_list: for user_or_group in allowedRolesAndUsers:
for role in local_roles: for role in local_roles:
allowedRolesAndUsers.append('%s:%s' % (user_or_group, role)) new_allowedRolesAndUsers.append('%s:%s' % (user_or_group, role))
allowedRolesAndUsers = new_allowedRolesAndUsers
return allowedRolesAndUsers return allowedRolesAndUsers
......
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