From 3f09da9f7d66b064519ad84d12e0f9e063ea9726 Mon Sep 17 00:00:00 2001 From: Romain Courteaud <romain@nexedi.com> Date: Thu, 25 Oct 2012 14:29:36 +0200 Subject: [PATCH] Drop open order based security configuration. --- .../Open%20Sale%20Order.xml | 5 - .../Sale%20Order.xml | 6 - .../Sale%20Packing%20List.xml | 6 - ...urityCategoryForPersonSoftwareInstance.xml | 92 ---------------- ...yFromMovementItemByHostingSubscription.xml | 100 ----------------- ...etSecurityCategoryFromRelatedOpenOrder.xml | 102 ----------------- .../ERP5Type_getSecurityCategoryMapping.xml | 4 - ...e_getSecurityCategoryFromOpenSaleOrder.xml | 104 ------------------ master/bt5/vifib_erp5/bt/revision | 2 +- 9 files changed, 1 insertion(+), 420 deletions(-) delete mode 100644 master/bt5/vifib_erp5/SkinTemplateItem/portal_skins/vifib_core/ERP5Type_getSecurityCategoryForPersonSoftwareInstance.xml delete mode 100644 master/bt5/vifib_erp5/SkinTemplateItem/portal_skins/vifib_core/ERP5Type_getSecurityCategoryFromMovementItemByHostingSubscription.xml delete mode 100644 master/bt5/vifib_erp5/SkinTemplateItem/portal_skins/vifib_core/ERP5Type_getSecurityCategoryFromRelatedOpenOrder.xml delete mode 100644 master/bt5/vifib_erp5/SkinTemplateItem/portal_skins/vifib_core/SaleTradeConditionType_getSecurityCategoryFromOpenSaleOrder.xml diff --git a/master/bt5/vifib_erp5/PortalTypeRolesTemplateItem/Open%20Sale%20Order.xml b/master/bt5/vifib_erp5/PortalTypeRolesTemplateItem/Open%20Sale%20Order.xml index ae4801664..634b80a79 100644 --- a/master/bt5/vifib_erp5/PortalTypeRolesTemplateItem/Open%20Sale%20Order.xml +++ b/master/bt5/vifib_erp5/PortalTypeRolesTemplateItem/Open%20Sale%20Order.xml @@ -10,9 +10,4 @@ <multi_property id='category'>group/company</multi_property> <multi_property id='base_category'>group</multi_property> </role> - <role id='Auditor'> - <property id='title'>Hosting Subscription related by self Lines</property> - <property id='base_category_script'>ERP5Type_getSecurityCategoryFromMovementItemByHostingSubscription</property> - <multi_property id='base_category'>aggregate</multi_property> - </role> </type_roles> \ No newline at end of file diff --git a/master/bt5/vifib_erp5/PortalTypeRolesTemplateItem/Sale%20Order.xml b/master/bt5/vifib_erp5/PortalTypeRolesTemplateItem/Sale%20Order.xml index 1226eb53d..6731177c9 100644 --- a/master/bt5/vifib_erp5/PortalTypeRolesTemplateItem/Sale%20Order.xml +++ b/master/bt5/vifib_erp5/PortalTypeRolesTemplateItem/Sale%20Order.xml @@ -22,10 +22,4 @@ <property id='base_category_script'>ERP5Type_getSecurityCategoryFromMovementItemBySoftwareInstance</property> <multi_property id='base_category'>source</multi_property> </role> - <role id='Auditor'> - <property id='title'>Software Instance User become Auditor of Sale Order related to Slave Instance</property> - <property id='description'>The software instances become auditor of sale orders related to Slave Instances if the Software Instance and Slave instance use the same software release and is installed in the same computer partition.</property> - <property id='base_category_script'>ERP5Type_getSecurityCategoryFromMovementItemByHostingSubscription</property> - <multi_property id='base_category'>aggregate</multi_property> - </role> </type_roles> \ No newline at end of file diff --git a/master/bt5/vifib_erp5/PortalTypeRolesTemplateItem/Sale%20Packing%20List.xml b/master/bt5/vifib_erp5/PortalTypeRolesTemplateItem/Sale%20Packing%20List.xml index 058387aa7..2c7cc25f2 100644 --- a/master/bt5/vifib_erp5/PortalTypeRolesTemplateItem/Sale%20Packing%20List.xml +++ b/master/bt5/vifib_erp5/PortalTypeRolesTemplateItem/Sale%20Packing%20List.xml @@ -28,10 +28,4 @@ <property id='base_category_script'>ERP5Type_getSecurityCategoryFromMovementItemBySoftwareInstance</property> <multi_property id='base_category'>source</multi_property> </role> - <role id='Auditor'> - <property id='title'>Software Instance related by Hosting Subscription</property> - <property id='description'>Monovalued role</property> - <property id='base_category_script'>ERP5Type_getSecurityCategoryFromMovementItemByHostingSubscription</property> - <multi_property id='base_category'>aggregate</multi_property> - </role> </type_roles> \ No newline at end of file diff --git a/master/bt5/vifib_erp5/SkinTemplateItem/portal_skins/vifib_core/ERP5Type_getSecurityCategoryForPersonSoftwareInstance.xml b/master/bt5/vifib_erp5/SkinTemplateItem/portal_skins/vifib_core/ERP5Type_getSecurityCategoryForPersonSoftwareInstance.xml deleted file mode 100644 index d3b18549b..000000000 --- a/master/bt5/vifib_erp5/SkinTemplateItem/portal_skins/vifib_core/ERP5Type_getSecurityCategoryForPersonSoftwareInstance.xml +++ /dev/null @@ -1,92 +0,0 @@ -<?xml version="1.0"?> -<ZopeData> - <record id="1" aka="AAAAAAAAAAE="> - <pickle> - <global name="PythonScript" module="Products.PythonScripts.PythonScript"/> - </pickle> - <pickle> - <dictionary> - <item> - <key> <string>Script_magic</string> </key> - <value> <int>3</int> </value> - </item> - <item> - <key> <string>_bind_names</string> </key> - <value> - <object> - <klass> - <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/> - </klass> - <tuple/> - <state> - <dictionary> - <item> - <key> <string>_asgns</string> </key> - <value> - <dictionary> - <item> - <key> <string>name_container</string> </key> - <value> <string>container</string> </value> - </item> - <item> - <key> <string>name_context</string> </key> - <value> <string>context</string> </value> - </item> - <item> - <key> <string>name_m_self</string> </key> - <value> <string>script</string> </value> - </item> - <item> - <key> <string>name_subpath</string> </key> - <value> <string>traverse_subpath</string> </value> - </item> - </dictionary> - </value> - </item> - </dictionary> - </state> - </object> - </value> - </item> - <item> - <key> <string>_body</string> </key> - <value> <string># XXX For now, this script requires proxy manager\n -\n -# base_category_list : list of category values we need to retrieve\n -# user_name : string obtained from getSecurityManager().getUser().getUserName() [NuxUserGroup]\n -# or from getSecurityManager().getUser().getId() [PluggableAuthService with ERP5GroupManager]\n -# object : object which we want to assign roles to.\n -# portal_type : portal type of object\n -\n -# must always return a list of dicts\n -\n -category_list = []\n -\n -if obj is None:\n - return []\n -\n -if obj.getPortalType() in ["Person", "Software Instance"]:\n - return [{"role": [\'role/open_order\']}]\n -return []\n -</string> </value> - </item> - <item> - <key> <string>_params</string> </key> - <value> <string>base_category_list, user_name, obj, portal_type</string> </value> - </item> - <item> - <key> <string>_proxy_roles</string> </key> - <value> - <tuple> - <string>Manager</string> - </tuple> - </value> - </item> - <item> - <key> <string>id</string> </key> - <value> <string>ERP5Type_getSecurityCategoryForPersonSoftwareInstance</string> </value> - </item> - </dictionary> - </pickle> - </record> -</ZopeData> diff --git a/master/bt5/vifib_erp5/SkinTemplateItem/portal_skins/vifib_core/ERP5Type_getSecurityCategoryFromMovementItemByHostingSubscription.xml b/master/bt5/vifib_erp5/SkinTemplateItem/portal_skins/vifib_core/ERP5Type_getSecurityCategoryFromMovementItemByHostingSubscription.xml deleted file mode 100644 index a3a942046..000000000 --- a/master/bt5/vifib_erp5/SkinTemplateItem/portal_skins/vifib_core/ERP5Type_getSecurityCategoryFromMovementItemByHostingSubscription.xml +++ /dev/null @@ -1,100 +0,0 @@ -<?xml version="1.0"?> -<ZopeData> - <record id="1" aka="AAAAAAAAAAE="> - <pickle> - <global name="PythonScript" module="Products.PythonScripts.PythonScript"/> - </pickle> - <pickle> - <dictionary> - <item> - <key> <string>Script_magic</string> </key> - <value> <int>3</int> </value> - </item> - <item> - <key> <string>_bind_names</string> </key> - <value> - <object> - <klass> - <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/> - </klass> - <tuple/> - <state> - <dictionary> - <item> - <key> <string>_asgns</string> </key> - <value> - <dictionary> - <item> - <key> <string>name_container</string> </key> - <value> <string>container</string> </value> - </item> - <item> - <key> <string>name_context</string> </key> - <value> <string>context</string> </value> - </item> - <item> - <key> <string>name_m_self</string> </key> - <value> <string>script</string> </value> - </item> - <item> - <key> <string>name_subpath</string> </key> - <value> <string>traverse_subpath</string> </value> - </item> - </dictionary> - </value> - </item> - </dictionary> - </state> - </object> - </value> - </item> - <item> - <key> <string>_body</string> </key> - <value> <string># XXX For now, this script requires proxy manager\n -\n -# base_category_list : list of category values we need to retrieve\n -# user_name : string obtained from getSecurityManager().getUser().getUserName() [NuxUserGroup]\n -# or from getSecurityManager().getUser().getId() [PluggableAuthService with ERP5GroupManager]\n -# object : object which we want to assign roles to.\n -# portal_type : portal type of object\n -\n -# must always return a list of dicts\n -\n -category_list = []\n -\n -if obj is None:\n - return []\n -\n -item_portal_type = "Hosting Subscription"\n -if obj.getPortalType() == \'Open Sale Order\':\n - movement_list = obj.contentValues(portal_type=\'Open Sale Order Line\')\n -else:\n - movement_list = obj.getMovementList()\n -for movement in movement_list:\n - item = movement.getAggregateValue(portal_type=item_portal_type)\n - if item is not None:\n - category_list.append({"aggregate": [item.getRelativeUrl()]})\n -\n -return category_list\n -</string> </value> - </item> - <item> - <key> <string>_params</string> </key> - <value> <string>base_category_list, user_name, obj, portal_type</string> </value> - </item> - <item> - <key> <string>_proxy_roles</string> </key> - <value> - <tuple> - <string>Manager</string> - </tuple> - </value> - </item> - <item> - <key> <string>id</string> </key> - <value> <string>ERP5Type_getSecurityCategoryFromMovementItemByHostingSubscription</string> </value> - </item> - </dictionary> - </pickle> - </record> -</ZopeData> diff --git a/master/bt5/vifib_erp5/SkinTemplateItem/portal_skins/vifib_core/ERP5Type_getSecurityCategoryFromRelatedOpenOrder.xml b/master/bt5/vifib_erp5/SkinTemplateItem/portal_skins/vifib_core/ERP5Type_getSecurityCategoryFromRelatedOpenOrder.xml deleted file mode 100644 index 6ccc30bc5..000000000 --- a/master/bt5/vifib_erp5/SkinTemplateItem/portal_skins/vifib_core/ERP5Type_getSecurityCategoryFromRelatedOpenOrder.xml +++ /dev/null @@ -1,102 +0,0 @@ -<?xml version="1.0"?> -<ZopeData> - <record id="1" aka="AAAAAAAAAAE="> - <pickle> - <global name="PythonScript" module="Products.PythonScripts.PythonScript"/> - </pickle> - <pickle> - <dictionary> - <item> - <key> <string>Script_magic</string> </key> - <value> <int>3</int> </value> - </item> - <item> - <key> <string>_bind_names</string> </key> - <value> - <object> - <klass> - <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/> - </klass> - <tuple/> - <state> - <dictionary> - <item> - <key> <string>_asgns</string> </key> - <value> - <dictionary> - <item> - <key> <string>name_container</string> </key> - <value> <string>container</string> </value> - </item> - <item> - <key> <string>name_context</string> </key> - <value> <string>context</string> </value> - </item> - <item> - <key> <string>name_m_self</string> </key> - <value> <string>script</string> </value> - </item> - <item> - <key> <string>name_subpath</string> </key> - <value> <string>traverse_subpath</string> </value> - </item> - </dictionary> - </value> - </item> - </dictionary> - </state> - </object> - </value> - </item> - <item> - <key> <string>_body</string> </key> - <value> <string># XXX For now, this script requires proxy manager\n -\n -# base_category_list : list of category values we need to retrieve\n -# user_name : string obtained from getSecurityManager().getUser().getUserName() [NuxUserGroup]\n -# or from getSecurityManager().getUser().getId() [PluggableAuthService with ERP5GroupManager]\n -# object : object which we want to assign roles to.\n -# portal_type : portal type of object\n -\n -# must always return a list of dicts\n -\n -category_list = []\n -\n -if obj is None:\n - return []\n -\n -if obj.getPortalType() == \'Person\':\n - open_sale_order = obj.getDestinationSectionRelatedValue(portal_type=\'Open Sale Order\')\n - if open_sale_order is not None and open_sale_order.getValidationState() == \'validated\':\n - return [{\'aggregate\': open_sale_order.getRelativeUrl()}]\n -\n -if obj.getPortalType() == \'Software Instance\':\n - hosting_subscription = obj.getAggregateValue(portal_type=\'Hosting Subscription\')\n - if hosting_subscription is not None:\n - open_sale_order_line = hosting_subscription.getAggregateRelatedValue(portal_type=\'Open Sale Order Line\')\n - if open_sale_order_line is not None and open_sale_order_line.getParentValue().getValidationState() == \'validated\':\n - return [{\'aggregate\': open_sale_order_line.getParentValue().getRelativeUrl()}]\n - \n -return []\n -</string> </value> - </item> - <item> - <key> <string>_params</string> </key> - <value> <string>base_category_list, user_name, obj, portal_type</string> </value> - </item> - <item> - <key> <string>_proxy_roles</string> </key> - <value> - <tuple> - <string>Manager</string> - </tuple> - </value> - </item> - <item> - <key> <string>id</string> </key> - <value> <string>ERP5Type_getSecurityCategoryFromRelatedOpenOrder</string> </value> - </item> - </dictionary> - </pickle> - </record> -</ZopeData> diff --git a/master/bt5/vifib_erp5/SkinTemplateItem/portal_skins/vifib_core/ERP5Type_getSecurityCategoryMapping.xml b/master/bt5/vifib_erp5/SkinTemplateItem/portal_skins/vifib_core/ERP5Type_getSecurityCategoryMapping.xml index 25e38d63c..00ff3336f 100644 --- a/master/bt5/vifib_erp5/SkinTemplateItem/portal_skins/vifib_core/ERP5Type_getSecurityCategoryMapping.xml +++ b/master/bt5/vifib_erp5/SkinTemplateItem/portal_skins/vifib_core/ERP5Type_getSecurityCategoryMapping.xml @@ -69,10 +69,6 @@ return (\n # Instance security\n (\'ERP5Type_getSoftwareInstanceSecurityCategory\', [\'role\']),\n (\'ERP5Type_getSoftwareInstanceSecurityCategory\', [\'aggregate\']),\n -\n - # Person + Instance additional secutity\n - (\'ERP5Type_getSecurityCategoryForPersonSoftwareInstance\', [\'role\']),\n - (\'ERP5Type_getSecurityCategoryFromRelatedOpenOrder\', [\'aggregate\']),\n \n )\n </string> </value> diff --git a/master/bt5/vifib_erp5/SkinTemplateItem/portal_skins/vifib_core/SaleTradeConditionType_getSecurityCategoryFromOpenSaleOrder.xml b/master/bt5/vifib_erp5/SkinTemplateItem/portal_skins/vifib_core/SaleTradeConditionType_getSecurityCategoryFromOpenSaleOrder.xml deleted file mode 100644 index 6f7a8e2a2..000000000 --- a/master/bt5/vifib_erp5/SkinTemplateItem/portal_skins/vifib_core/SaleTradeConditionType_getSecurityCategoryFromOpenSaleOrder.xml +++ /dev/null @@ -1,104 +0,0 @@ -<?xml version="1.0"?> -<ZopeData> - <record id="1" aka="AAAAAAAAAAE="> - <pickle> - <global name="PythonScript" module="Products.PythonScripts.PythonScript"/> - </pickle> - <pickle> - <dictionary> - <item> - <key> <string>Script_magic</string> </key> - <value> <int>3</int> </value> - </item> - <item> - <key> <string>_bind_names</string> </key> - <value> - <object> - <klass> - <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/> - </klass> - <tuple/> - <state> - <dictionary> - <item> - <key> <string>_asgns</string> </key> - <value> - <dictionary> - <item> - <key> <string>name_container</string> </key> - <value> <string>container</string> </value> - </item> - <item> - <key> <string>name_context</string> </key> - <value> <string>context</string> </value> - </item> - <item> - <key> <string>name_m_self</string> </key> - <value> <string>script</string> </value> - </item> - <item> - <key> <string>name_subpath</string> </key> - <value> <string>traverse_subpath</string> </value> - </item> - </dictionary> - </value> - </item> - </dictionary> - </state> - </object> - </value> - </item> - <item> - <key> <string>_body</string> </key> - <value> <string># XXX For now, this script requires proxy manager\n -\n -# base_category_list : list of category values we need to retrieve\n -# user_name : string obtained from getSecurityManager().getUser().getUserName() [NuxUserGroup]\n -# or from getSecurityManager().getUser().getId() [PluggableAuthService with ERP5GroupManager]\n -# object : object which we want to assign roles to.\n -# portal_type : portal type of object\n -\n -# must always return a list of dicts\n -\n -category_list = []\n -\n -if obj is None:\n - return []\n -\n -portal = obj.getPortalObject()\n -person_list = []\n -person_list.extend(obj.getDestinationSectionValueList(portal_type="Person"))\n -\n -for person in person_list:\n - for open_order in portal.portal_catalog(\n - portal_type="Open Sale Order",\n - validation_state="validated",\n - destination_decision_relative_url=person.getRelativeUrl()):\n - category_list.append(open_order)\n -\n -if category_list:\n - return {"Auditor": [x.getReference() for x in category_list]}\n -else:\n - return []\n -</string> </value> - </item> - <item> - <key> <string>_params</string> </key> - <value> <string>base_category_list, user_name, obj, portal_type</string> </value> - </item> - <item> - <key> <string>_proxy_roles</string> </key> - <value> - <tuple> - <string>Manager</string> - </tuple> - </value> - </item> - <item> - <key> <string>id</string> </key> - <value> <string>SaleTradeConditionType_getSecurityCategoryFromOpenSaleOrder</string> </value> - </item> - </dictionary> - </pickle> - </record> -</ZopeData> diff --git a/master/bt5/vifib_erp5/bt/revision b/master/bt5/vifib_erp5/bt/revision index c047c4aba..82cf07969 100644 --- a/master/bt5/vifib_erp5/bt/revision +++ b/master/bt5/vifib_erp5/bt/revision @@ -1 +1 @@ -518 \ No newline at end of file +519 \ No newline at end of file -- 2.30.9