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 @@
</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>
......
......@@ -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>
......
......@@ -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>
......
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
......
760
\ No newline at end of file
761
\ 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