diff --git a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Type_getSecurityCategoryFromAcquiredArrow.xml b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Type_getSecurityAcquiredCategoryFromContent.xml similarity index 85% rename from product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Type_getSecurityCategoryFromAcquiredArrow.xml rename to product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Type_getSecurityAcquiredCategoryFromContent.xml index 697bd9935a17b6cb2377bba56d1abfda0d17492e..bcd49de5d5f16cbee1b9cc6def327c67a795d5d5 100644 --- a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Type_getSecurityCategoryFromAcquiredArrow.xml +++ b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Type_getSecurityAcquiredCategoryFromContent.xml @@ -65,9 +65,16 @@ </item> <item> <key> <string>_body</string> </key> - <value> <string>"""This is the same as ERP5Type_getSecurityCategoryFromArrow, but with acquisition on categories.\n -"""\n + <value> <string>"""This script is similar to ERP5Type_getSecurityCategoryFromContent, but it\n +uses acquisition to get categories.\n +\n +Note that if you design a security with acquired categories you may have problems\n +to regenerate security dynamically when thoses acquired values are modified on other\n +documents from which we acquire those values, just because this "other document" doesn\'t\n +know which documents are acquiring values.\n \n +If unsure, you should use ERP5Type_getSecurityCategoryFromContent.\n +"""\n category_list = []\n \n if object is None:\n @@ -105,7 +112,14 @@ return category_list\n <key> <string>_proxy_roles</string> </key> <value> <tuple> + <string>Assignee</string> + <string>Assignor</string> + <string>Associate</string> + <string>Auditor</string> + <string>Authenticated</string> + <string>Author</string> <string>Manager</string> + <string>Member</string> </tuple> </value> </item> @@ -158,7 +172,7 @@ return category_list\n </item> <item> <key> <string>id</string> </key> - <value> <string>ERP5Type_getSecurityCategoryFromAcquiredArrow</string> </value> + <value> <string>ERP5Type_getSecurityAcquiredCategoryFromContent</string> </value> </item> <item> <key> <string>warnings</string> </key> diff --git a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Type_getSecurityCategoryFromArrow.xml b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Type_getSecurityCategoryFromArrow.xml index 4f077961ef21d7ce3f75c496d6ef2262c7154c22..16970cee2535a8b60099f51dbb4b3a29a488d1b5 100644 --- a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Type_getSecurityCategoryFromArrow.xml +++ b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Type_getSecurityCategoryFromArrow.xml @@ -65,25 +65,12 @@ </item> <item> <key> <string>_body</string> </key> - <value> <string># XXX For now, this script requires proxy manager\n + <value> <string>from Products.ERP5Type.Log import log\n +log("ERP5Type_getSecurityCategoryFromArrow is deprecated, "\n + "use ERP5Type_getSecurityCategoryFromContent instead")\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 object is None:\n - return []\n -\n -for base_category in base_category_list:\n - category_list.append({base_category: object.getCategoryMembershipList(base_category)})\n -\n -return category_list\n +return context.ERP5Type_getSecurityCategoryFromContent(\n + base_category_list, user_name, object, portal_type)\n </string> </value> </item> <item> @@ -144,11 +131,10 @@ return category_list\n <string>user_name</string> <string>object</string> <string>portal_type</string> - <string>category_list</string> - <string>None</string> - <string>_getiter_</string> - <string>base_category</string> + <string>Products.ERP5Type.Log</string> + <string>log</string> <string>_getattr_</string> + <string>context</string> </tuple> </value> </item> diff --git a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Type_getSecurityCategoryFromContent.xml b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Type_getSecurityCategoryFromContent.xml index 688a33632d48886f4d1a09824f4074e9a080b82c..dfbf4ddf945b8a3fd002e574c6076dd98231bba1 100644 --- a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Type_getSecurityCategoryFromContent.xml +++ b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Type_getSecurityCategoryFromContent.xml @@ -3,11 +3,8 @@ <record id="1" aka="AAAAAAAAAAE="> <pickle> <tuple> - <tuple> - <string>Products.PythonScripts.PythonScript</string> - <string>PythonScript</string> - </tuple> - <none/> + <global name="PythonScript" module="Products.PythonScripts.PythonScript"/> + <tuple/> </tuple> </pickle> <pickle> @@ -101,7 +98,7 @@ if object is None:\n return []\n \n for base_category in base_category_list:\n - category_list.append({base_category: object.getAcquiredCategoryMembershipList(base_category)})\n + category_list.append({base_category: object.getCategoryMembershipList(base_category)})\n \n return category_list\n </string> </value> @@ -118,10 +115,31 @@ return category_list\n <none/> </value> </item> + <item> + <key> <string>_owner</string> </key> + <value> + <none/> + </value> + </item> <item> <key> <string>_params</string> </key> <value> <string>base_category_list, user_name, object, portal_type</string> </value> </item> + <item> + <key> <string>_proxy_roles</string> </key> + <value> + <tuple> + <string>Assignee</string> + <string>Assignor</string> + <string>Associate</string> + <string>Auditor</string> + <string>Authenticated</string> + <string>Author</string> + <string>Manager</string> + <string>Member</string> + </tuple> + </value> + </item> <item> <key> <string>errors</string> </key> <value> diff --git a/product/ERP5/bootstrap/erp5_core/bt/change_log b/product/ERP5/bootstrap/erp5_core/bt/change_log index 495a35e257178762d07bafb7f8fa5912f3635db2..ca69428b0cefc74c1d5c60ca241322e3d67efbb9 100644 --- a/product/ERP5/bootstrap/erp5_core/bt/change_log +++ b/product/ERP5/bootstrap/erp5_core/bt/change_log @@ -1,3 +1,7 @@ +2008-03-20 Jerome +* don't get acquired categories in ERP5Type_getSecurityCategoryFromContent and introduce ERP5Type_getSecurityAcquiredCategoryFromContent to get acquired categories. +* deprecate ERP5Type_getSecurityCategoryFromArrow for ERP5Type_getSecurityCategoryFromContent + 2008-03-18 Nicolas *Add support of OOoChart in ERP5 *Modifiy Preference_viewHtmlStyle Form diff --git a/product/ERP5/bootstrap/erp5_core/bt/revision b/product/ERP5/bootstrap/erp5_core/bt/revision index cbb5735d831582b9cb1038377ec1114c6c947561..a4c65e3658d96d89669da7564bc7dadfbf629ed9 100644 --- a/product/ERP5/bootstrap/erp5_core/bt/revision +++ b/product/ERP5/bootstrap/erp5_core/bt/revision @@ -1 +1 @@ -760 \ No newline at end of file +761 \ No newline at end of file