Commit fafaba33 authored by Jérome Perrin's avatar Jérome Perrin

core: don't set guard on edit_action

This action is typically used to add notes in history in scripts,
including in cases where user does not have modify portal content
permission on the document.
parent 9e6a8cfa
...@@ -1150,6 +1150,16 @@ class TestERP5Base(ERP5TypeTestCase): ...@@ -1150,6 +1150,16 @@ class TestERP5Base(ERP5TypeTestCase):
# workflow is affected # workflow is affected
self.assertTrue(comment in [q['comment'] for q in workflow_history ]) self.assertTrue(comment in [q['comment'] for q in workflow_history ])
def test_comment_edit_workflow_edit_action_permission(self):
# no special permission is needed to programatically use edit_action from edit_workflow
comment = 'some comment'
person = self.portal.person_module.newContent(portal_type='Person')
self.logout()
self.portal.portal_workflow.doActionFor(person, 'edit_action', comment=comment)
workflow_history = self.getWorkflowHistory(person, 'edit_workflow')
# workflow is affected
self.assertIn(comment, [q['comment'] for q in workflow_history ])
def test_comment_validation_workflow(self): def test_comment_validation_workflow(self):
comment = 'some comment' comment = 'some comment'
person = self.portal.person_module.newContent(portal_type='Person') person = self.portal.person_module.newContent(portal_type='Person')
......
...@@ -39,9 +39,7 @@ ...@@ -39,9 +39,7 @@
<item> <item>
<key> <string>guard_permission</string> </key> <key> <string>guard_permission</string> </key>
<value> <value>
<tuple> <tuple/>
<string>Modify portal content</string>
</tuple>
</value> </value>
</item> </item>
<item> <item>
......
...@@ -42,6 +42,7 @@ from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase ...@@ -42,6 +42,7 @@ from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
class TestSecurityMixin(ERP5TypeTestCase): class TestSecurityMixin(ERP5TypeTestCase):
workflow_transition_protection_ignored_workflow_id_list = ( workflow_transition_protection_ignored_workflow_id_list = (
'edit_workflow',
) )
def _prepareDocumentList(self): def _prepareDocumentList(self):
......
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