Skip to content

Commit

Permalink
Make MeetingItem.marginalNotes field editable by MeetingManagers
Browse files Browse the repository at this point in the history
…when item is `presented` (before it was when item was `itemfrozen`) so votes are also editable when item is `presented` as it relies on same permission `WriteMarginalNotes` that we should change name to a more generic name like `WriteClosedMeetingMeetingManagersReservedFields`.

See #DLIBBDC-3401
  • Loading branch information
gbastien committed Dec 18, 2024
1 parent adbe7da commit 23e6a08
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
6 changes: 6 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ Changelog
empty, it was not emptying the value on new item, now it is the case except
for `title` that can not be empty.
[gbastien]
- Make `MeetingItem.marginalNotes` field editable by `MeetingManagers` when item
is `presented` (before it was when item was `itemfrozen`) so votes are also
editable when item is `presented` as it relies on same permission
`WriteMarginalNotes` that we should change name to a more generic name like
`WriteClosedMeetingMeetingManagersReservedFields`.
[gbastien]

4.2.13 (2024-12-06)
-------------------
Expand Down
Binary file modified src/Products/PloneMeeting/model/PloneMeeting.zargo
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@
<permission-map name="PloneMeeting: Write marginal notes"
acquired="False">
<permission-role>Manager</permission-role>
<permission-role>MeetingManager</permission-role>
</permission-map>
<permission-map name="Review portal content"
acquired="False">
Expand Down
15 changes: 8 additions & 7 deletions src/Products/PloneMeeting/tests/testWorkflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -973,26 +973,27 @@ def test_pm_ItemMarginalNotes(self):
item = self.create('MeetingItem')
item.setDecision(self.decisionText)
# field not writeable
marginalNotesField = item.getField('marginalNotes')
self.assertFalse(marginalNotesField.writeable(item))
marginal_notes_field = item.getField('marginalNotes')
self.assertFalse(marginal_notes_field.writeable(item))
self.assertFalse(item.mayQuickEdit('marginalNotes'))
self.validateItem(item)

# as MeetingManager
self.changeUser('pmManager')
# field not writeable
self.assertFalse(marginalNotesField.writeable(item))
self.assertFalse(marginal_notes_field.writeable(item))
self.assertFalse(item.mayQuickEdit('marginalNotes'))
# writeable when "presented"
meeting = self.create('Meeting')
self.presentItem(item)
self.assertEqual(item.query_state(), 'presented')
self.assertFalse(marginalNotesField.writeable(item))
self.assertFalse(item.mayQuickEdit('marginalNotes'))
self.assertTrue(marginal_notes_field.writeable(item))
self.assertTrue(item.mayQuickEdit('marginalNotes'))

# writeable when meeting frozen
self.freezeMeeting(meeting)
self.assertEqual(item.query_state(), 'itemfrozen')
self.assertTrue(marginalNotesField.writeable(item))
self.assertTrue(marginal_notes_field.writeable(item))
self.assertTrue(item.mayQuickEdit('marginalNotes'))
# as other fields
obsField = item.getField('observations')
Expand All @@ -1003,7 +1004,7 @@ def test_pm_ItemMarginalNotes(self):
self.closeMeeting(meeting)
self.assertEqual(meeting.query_state(), 'closed')
self.assertEqual(item.query_state(), 'accepted')
self.assertTrue(marginalNotesField.writeable(item))
self.assertTrue(marginal_notes_field.writeable(item))
self.assertTrue(item.mayQuickEdit('marginalNotes'))
# but not other fields
self.assertFalse(obsField.writeable(item))
Expand Down

0 comments on commit 23e6a08

Please sign in to comment.