Commit 46c6f19f authored by Jérome Perrin's avatar Jérome Perrin

when copy/paste a person, reset the login on the new person for ERP5Security.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@9142 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6a20b839
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.PythonScripts.PythonScript</string>
<string>PythonScript</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Python_magic</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</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>"""Hook called when a person object is closed.\n
\n
We want to reset the reference, which is the user login in ERP5Security.\n
"""\n
context.setReference(None)\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_filepath</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>_getattr_</string>
<string>context</string>
<string>None</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Person_afterClone</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
2006-08-11 jerome
* when copy/paste a person, reset the login on the new person for ERP5Security.
2006-08-06 jerome 2006-08-06 jerome
* remove skins to create module using a scribus file; they are now part of erp5_pdf_editor. * remove skins to create module using a scribus file; they are now part of erp5_pdf_editor.
......
38 40
\ No newline at end of file \ No newline at end of file
...@@ -188,6 +188,15 @@ class TestERP5Security(ERP5TypeTestCase): ...@@ -188,6 +188,15 @@ class TestERP5Security(ERP5TypeTestCase):
self._makePerson(reference='new_person') self._makePerson(reference='new_person')
self.assertRaises(RuntimeError, self._makePerson, reference='new_person') self.assertRaises(RuntimeError, self._makePerson, reference='new_person')
def test_PersonCopyAndPaste(self, run=RUN_ALL_TESTS):
"""If we copy and paste a person, login must not be copyied."""
person = self._makePerson(reference='new_person')
person_module = self.getPersonModule()
copy_data = person_module.manage_copyObjects([person.getId()])
changed, = person_module.manage_pasteObjects(copy_data)
self.assertNotEquals(person_module[changed['new_id']].getReference(),
person_module[changed['id']].getReference())
if __name__ == '__main__': if __name__ == '__main__':
framework() framework()
else: else:
......
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