Commit 6e31c399 authored by Gabriel Monnerat's avatar Gabriel Monnerat

rename script and remove manage proxy role because if normal user use this...

rename script and remove manage proxy role because if normal user use this script, the user will access a wrong knowledge pad

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@45433 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 22aeeaac
...@@ -52,34 +52,32 @@ ...@@ -52,34 +52,32 @@
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>portal_catalog = context.portal_catalog\n <value> <string>portal_catalog = context.portal_catalog\n
\n \n
gadget_id_list = context.REQUEST.form.get("gadget_id_list")\n
if not gadget_id_list:\n
return None\n
\n
gadget_id_list = gadget_id_list.split(",")\n
knowledge_pad = portal_catalog.getResultValue(portal_type="Knowledge Pad",\n knowledge_pad = portal_catalog.getResultValue(portal_type="Knowledge Pad",\n
publication_section_uid=context.getUid(),\n publication_section_uid=context.getUid(),\n
validation_state=["visible", "public"])\n validation_state=["visible", "public"])\n
\n \n
knowledge_box = knowledge_pad.newContent(portal_type="Knowledge Box")\n for gadget_id in gadget_id_list:\n
gadget_relative_url = "portal_gadgets/%s" % gadget_id\n knowledge_box = knowledge_pad.newContent(portal_type="Knowledge Box")\n
gadget = portal_catalog.getResultValue(portal_type="Gadget", id=gadget_id)\n gadget_relative_url = "portal_gadgets/%s" % gadget_id\n
if gadget.getValidationState() == "invisible":\n gadget = portal_catalog.getResultValue(portal_type="Gadget", id=gadget_id)\n
if gadget.getValidationState() == "invisible":\n
gadget.visible()\n gadget.visible()\n
knowledge_box.setSpecialise(gadget_relative_url)\n knowledge_box.setSpecialise(gadget_relative_url)\n
knowledge_box.visible()\n knowledge_box.visible()\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>gadget_id</string> </value> <value> <string></string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>WebSection_addGadget</string> </value> <value> <string>WebSection_addGadgetList</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
353 354
\ 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