[Erp5-report] r15433 - in /erp5/trunk/products: ERP5Catalog/ ERP5Type/patches/
nobody at svn.erp5.org
nobody at svn.erp5.org
Fri Aug 3 10:04:39 CEST 2007
Author: vincent
Date: Fri Aug 3 10:04:39 2007
New Revision: 15433
URL: http://svn.erp5.org?rev=15433&view=rev
Log:
Replace new method getSecurityUidList by getSecurityUidListAndRoleColumnDict, because roles_column_dict must be handled along with security uids.
Update partially WorkflowTool patch.
Modified:
erp5/trunk/products/ERP5Catalog/CatalogTool.py
erp5/trunk/products/ERP5Type/patches/WorkflowTool.py
Modified: erp5/trunk/products/ERP5Catalog/CatalogTool.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Catalog/CatalogTool.py?rev=15433&r1=15432&r2=15433&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Catalog/CatalogTool.py (original)
+++ erp5/trunk/products/ERP5Catalog/CatalogTool.py Fri Aug 3 10:04:39 2007
@@ -460,9 +460,11 @@
return allowedRolesAndUsers, role_column_dict
- def getSecurityUidList(self, **kw):
- """
- Return a list of security Uids.
+ def getSecurityUidListAndRoleColumnDict(self, **kw):
+ """
+ Return a list of security Uids and a dictionnary containing available
+ role columns.
+
TODO: Add a cache.
"""
allowedRolesAndUsers, role_column_dict = self.getAllowedRolesAndUsers(**kw)
@@ -470,7 +472,7 @@
method = getattr(catalog, catalog.sql_search_security)
allowedRolesAndUsers = ["'%s'" % (role, ) for role in allowedRolesAndUsers]
security_uid_list = [x.uid for x in method(security_roles_list = allowedRolesAndUsers)]
- return security_uid_list
+ return security_uid_list, role_column_dict
security.declarePublic( 'getSecurityQuery' )
def getSecurityQuery(self, query=None, **kw):
Modified: erp5/trunk/products/ERP5Type/patches/WorkflowTool.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/patches/WorkflowTool.py?rev=15433&r1=15432&r2=15433&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/patches/WorkflowTool.py (original)
+++ erp5/trunk/products/ERP5Type/patches/WorkflowTool.py Fri Aug 3 10:04:39 2007
@@ -113,7 +113,7 @@
COUNT_COLUMN_TITLE = 'count'
INTERNAL_CRITERION_KEY_LIST = (WORKLIST_METADATA_KEY, SECURITY_PARAMETER_ID)
-def groupWorklistListByCondition(worklist_dict, acceptable_key_dict, getSecurityUidList):
+def groupWorklistListByCondition(worklist_dict, acceptable_key_dict, getSecurityUidListAndRoleColumnDict):
"""
Get a list of dict of WorklistVariableMatchDict grouped by compatible conditions.
Strip any variable which is not a catalog column.
@@ -158,8 +158,10 @@
if security_cache_key in security_cache:
criterion_value = security_cache[security_cache_key]
else:
- security_query = getSecurityUidList(**{criterion_id: criterion_value})
- criterion_value = security_query
+ security_uid_list, role_column_dict = getSecurityUidListAndRoleColumnDict(**{criterion_id: criterion_value})
+ # XXX: role_column_dict is ignored for now. This must be
+ # implemented.
+ criterion_value = security_uid_list
security_cache[security_cache_key] = criterion_value
criterion_id = SECURITY_COLUMN_ID
else:
More information about the Erp5-report
mailing list