Commit 4e19246d authored by Jérome Perrin's avatar Jérome Perrin

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

see http://mail.nexedi.com/pipermail/erp5-dev/2008-March/001690.html for more info.

Also add missing proxy role on ERP5Type_getSecurityCategoryFromContent (the docstring says it requires a proxy role)

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@20088 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f131c448
...@@ -65,9 +65,16 @@ ...@@ -65,9 +65,16 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>"""This is the same as ERP5Type_getSecurityCategoryFromArrow, but with acquisition on categories.\n <value> <string>"""This script is similar to ERP5Type_getSecurityCategoryFromContent, but it\n
"""\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 \n
If unsure, you should use ERP5Type_getSecurityCategoryFromContent.\n
"""\n
category_list = []\n category_list = []\n
\n \n
if object is None:\n if object is None:\n
...@@ -105,7 +112,14 @@ return category_list\n ...@@ -105,7 +112,14 @@ return category_list\n
<key> <string>_proxy_roles</string> </key> <key> <string>_proxy_roles</string> </key>
<value> <value>
<tuple> <tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Authenticated</string>
<string>Author</string>
<string>Manager</string> <string>Manager</string>
<string>Member</string>
</tuple> </tuple>
</value> </value>
</item> </item>
...@@ -158,7 +172,7 @@ return category_list\n ...@@ -158,7 +172,7 @@ return category_list\n
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>ERP5Type_getSecurityCategoryFromAcquiredArrow</string> </value> <value> <string>ERP5Type_getSecurityAcquiredCategoryFromContent</string> </value>
</item> </item>
<item> <item>
<key> <string>warnings</string> </key> <key> <string>warnings</string> </key>
......
...@@ -65,25 +65,12 @@ ...@@ -65,25 +65,12 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <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 \n
# base_category_list : list of category values we need to retrieve\n return context.ERP5Type_getSecurityCategoryFromContent(\n
# user_name : string obtained from getSecurityManager().getUser().getUserName() [NuxUserGroup]\n base_category_list, user_name, object, portal_type)\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
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -144,11 +131,10 @@ return category_list\n ...@@ -144,11 +131,10 @@ return category_list\n
<string>user_name</string> <string>user_name</string>
<string>object</string> <string>object</string>
<string>portal_type</string> <string>portal_type</string>
<string>category_list</string> <string>Products.ERP5Type.Log</string>
<string>None</string> <string>log</string>
<string>_getiter_</string>
<string>base_category</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -3,11 +3,8 @@ ...@@ -3,11 +3,8 @@
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<string>Products.PythonScripts.PythonScript</string> <tuple/>
<string>PythonScript</string>
</tuple>
<none/>
</tuple> </tuple>
</pickle> </pickle>
<pickle> <pickle>
...@@ -101,7 +98,7 @@ if object is None:\n ...@@ -101,7 +98,7 @@ if object is None:\n
return []\n return []\n
\n \n
for base_category in base_category_list:\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 \n
return category_list\n return category_list\n
</string> </value> </string> </value>
...@@ -118,10 +115,31 @@ return category_list\n ...@@ -118,10 +115,31 @@ return category_list\n
<none/> <none/>
</value> </value>
</item> </item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>base_category_list, user_name, object, portal_type</string> </value> <value> <string>base_category_list, user_name, object, portal_type</string> </value>
</item> </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> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
<value> <value>
......
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 2008-03-18 Nicolas
*Add support of OOoChart in ERP5 *Add support of OOoChart in ERP5
*Modifiy Preference_viewHtmlStyle Form *Modifiy Preference_viewHtmlStyle Form
......
760 761
\ No newline at end of file \ No newline at end of file
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