Commit d5972326 authored by Romain Courteaud's avatar Romain Courteaud

Catalog the 'Owner' role, as other roles, because it is usefull for creating worklists.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@12828 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 14a866f6
...@@ -134,18 +134,10 @@ class IndexableObjectWrapper(CMFCoreIndexableObjectWrapper): ...@@ -134,18 +134,10 @@ class IndexableObjectWrapper(CMFCoreIndexableObjectWrapper):
allowed[user] = 1 allowed[user] = 1
else: else:
allowed['user:' + user] = 1 allowed['user:' + user] = 1
# Added for ERP5 project by JP Smets if withnuxgroups:
# The reason why we do not want to keep Owner is because we are allowed[user + ':' + role] = 1
# trying to reduce the number of security definitions else:
# However, this could be a bad idea if we start to use Owner role allowed['user:' + user + ':' + role] = 1
# as a kind of Assignee and if we need it for worklists.
if role != 'Owner':
if withnuxgroups:
allowed[user + ':' + role] = 1
else:
allowed['user:' + user + ':' + role] = 1
if allowed.has_key('Owner'):
del allowed['Owner']
return list(allowed.keys()) return list(allowed.keys())
class RelatedBaseCategory(Method): class RelatedBaseCategory(Method):
...@@ -415,12 +407,7 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject): ...@@ -415,12 +407,7 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
# 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 allowedRolesAndUsers: for user_or_group in allowedRolesAndUsers:
for role in local_roles: for role in local_roles:
if role == "Owner": new_allowedRolesAndUsers.append('%s:%s' % (user_or_group, role))
# This is for now only a placeholder to handle the case of Owner
# which may not be supported (see above comment arround line 135
new_allowedRolesAndUsers.append('%s:%s' % (user_or_group, role))
else:
new_allowedRolesAndUsers.append('%s:%s' % (user_or_group, role))
allowedRolesAndUsers = new_allowedRolesAndUsers 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