[Erp5-report] r31017 jerome - in /erp5/trunk/products/ERP5/bootstrap/erp5_core: SkinTemplat...

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Dec 3 11:15:42 CET 2009


Author: jerome
Date: Thu Dec  3 11:15:40 2009
New Revision: 31017

URL: http://svn.erp5.org?rev=31017&view=rev
Log:
Only show links to historical comparisons and previous versions if the user has "View History" permission.

About backward compatibility, this permission is given to  Assignee, Assignor, Associate, Auditor in the modules and usually acquired on modules. So all users (besides Anonymous, this is a change) will be able to view historical comparisons.

Modified:
    erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getWorkflowHistoryItemList.xml
    erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision

Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getWorkflowHistoryItemList.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getWorkflowHistoryItemList.xml?rev=31017&r1=31016&r2=31017&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getWorkflowHistoryItemList.xml [utf8] (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getWorkflowHistoryItemList.xml [utf8] Thu Dec  3 11:15:40 2009
@@ -58,6 +58,9 @@
 from Products.ERP5Type.Document import newTempMappedValue\n
 from Products.ERP5Type.Utils import getTranslationStringWithContext\n
 \n
+from AccessControl import getSecurityManager\n
+\n
+can_view_history = getSecurityManager().getUser().has_permission(\'View History\', context)\n
 \n
 marker = []\n
 result = []\n
@@ -100,6 +103,8 @@
   o = newTempBase(portal_object, str(i))\n
   i += 1\n
   for key, value in workflow_item.items():\n
+    if key == \'serial\' and not can_view_history:\n
+      continue\n
     # XXX Compatibility\n
     for compatibility_name in [\'building_\', \'installation_\']:\n
       if key.startswith(compatibility_name):\n
@@ -135,7 +140,7 @@
     o.setProperty(key, value)\n
  \n
   # record current serial as "next serial" for the previous revision\n
-  if next_serial is not None:\n
+  if next_serial is not None and can_view_history:\n
     previous_obj.setProperty(\'next_serial\', o.serial)\n
   next_serial = getattr(o, \'serial\', None)\n
   previous_obj = o\n
@@ -207,6 +212,9 @@
                             <string>newTempMappedValue</string>
                             <string>Products.ERP5Type.Utils</string>
                             <string>getTranslationStringWithContext</string>
+                            <string>AccessControl</string>
+                            <string>getSecurityManager</string>
+                            <string>can_view_history</string>
                             <string>marker</string>
                             <string>result</string>
                             <string>i</string>

Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision?rev=31017&r1=31016&r2=31017&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision [utf8] (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision [utf8] Thu Dec  3 11:15:40 2009
@@ -1,1 +1,1 @@
-1391
+1392




More information about the Erp5-report mailing list