diff --git a/CHANGES.rst b/CHANGES.rst index b2b6b092..21ebb3fe 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -8,6 +8,9 @@ Changelog - Change bookings default limit to 0. [folix-01] +- Fix Bookings Manager permission in according to expected behavior + [folix-01] + - Add booking_refuse_message to Prenotazione stringinterp variables. [folix-01] diff --git a/src/redturtle/prenotazioni/profiles/default/metadata.xml b/src/redturtle/prenotazioni/profiles/default/metadata.xml index 0d57cafc..3bf47486 100644 --- a/src/redturtle/prenotazioni/profiles/default/metadata.xml +++ b/src/redturtle/prenotazioni/profiles/default/metadata.xml @@ -1,6 +1,6 @@ - 1807 + 1808 profile-plone.app.dexterity:default profile-collective.z3cform.datagridfield:default diff --git a/src/redturtle/prenotazioni/profiles/default/rolemap.xml b/src/redturtle/prenotazioni/profiles/default/rolemap.xml index 214bbabc..57a6571f 100644 --- a/src/redturtle/prenotazioni/profiles/default/rolemap.xml +++ b/src/redturtle/prenotazioni/profiles/default/rolemap.xml @@ -4,8 +4,8 @@ - + diff --git a/src/redturtle/prenotazioni/profiles/default/workflows/prenotazioni_workflow/definition.xml b/src/redturtle/prenotazioni/profiles/default/workflows/prenotazioni_workflow/definition.xml index 94af7300..5fb28d83 100644 --- a/src/redturtle/prenotazioni/profiles/default/workflows/prenotazioni_workflow/definition.xml +++ b/src/redturtle/prenotazioni/profiles/default/workflows/prenotazioni_workflow/definition.xml @@ -3,6 +3,7 @@ Access contents information Modify portal content View + redturtle.prenotazioni: Manage Prenotazioni Waiting to be reviewed, not editable by the owner and not visible @@ -13,10 +14,12 @@ Manager Reader Reviewer + Bookings Manager Manager Reviewer + Bookings Manager Owner @@ -24,6 +27,12 @@ Manager Reader Reviewer + Bookings Manager + + + Manager + Reviewer + Bookings Manager @@ -35,12 +44,14 @@ Manager Owner Reader + Bookings Manager Anonymous Editor Manager Owner + Bookings Manager Anonymous @@ -48,6 +59,12 @@ Manager Owner Reader + Bookings Manager + + + Manager + Reviewer + Bookings Manager @@ -58,10 +75,12 @@ Manager Reader Reviewer + Bookings Manager Manager Reviewer + Bookings Manager Owner @@ -69,6 +88,12 @@ Manager Reader Reviewer + Bookings Manager + + + Manager + Reviewer + Bookings Manager @@ -79,10 +104,12 @@ Owner Reader Reviewer + Bookings Manager Manager Reviewer + Bookings Manager Editor @@ -90,6 +117,12 @@ Owner Reader Reviewer + Bookings Manager + + + Manager + Reviewer + Bookings Manager diff --git a/src/redturtle/prenotazioni/restapi/services/bookings/search.py b/src/redturtle/prenotazioni/restapi/services/bookings/search.py index 0d108f34..b0019b26 100644 --- a/src/redturtle/prenotazioni/restapi/services/bookings/search.py +++ b/src/redturtle/prenotazioni/restapi/services/bookings/search.py @@ -82,6 +82,7 @@ def reply(self): )() for i in api.portal.get_tool("portal_catalog")(**query) ] + response["items_total"] = len(response["items"]) return response diff --git a/src/redturtle/prenotazioni/upgrades.py b/src/redturtle/prenotazioni/upgrades.py index 939e634d..14fddc7a 100644 --- a/src/redturtle/prenotazioni/upgrades.py +++ b/src/redturtle/prenotazioni/upgrades.py @@ -60,6 +60,10 @@ def update_sharing(context): update_profile(context, "sharing") +def update_workflow(context): + update_profile(context, "workflow") + + def reload_gs_profile(context): loadMigrationProfile( context, @@ -376,7 +380,7 @@ def to_1700(context): setattr(prenotazione, field, date.astimezone(tz)) -def to_1800(self): +def to_1800(context): brains = api.content.find(portal_type="PrenotazioniFolder") for brain in brains: item = brain.getObject() @@ -388,7 +392,7 @@ def to_1800(self): ) -def update_booking_code(self): +def update_booking_code(context): brains = api.content.find(portal_type="Prenotazione") for brain in brains: item = brain.getObject() @@ -400,7 +404,7 @@ def update_booking_code(self): ) -def to_1804(self): +def to_1804(context): for brain in api.portal.get_tool("portal_catalog")( portal_type="PrenotazioniFolder" ): @@ -408,7 +412,7 @@ def to_1804(self): brain.getObject().max_bookings_allowed = 2 -def to_1805(self): +def to_1805(context): from plone.app.textfield.value import RichTextValue for brain in api.portal.get_tool("portal_catalog")( @@ -428,7 +432,7 @@ def to_1805(self): ) -def to_1806(self): +def to_1806(context): for brain in api.portal.get_tool("portal_catalog")( portal_type="PrenotazioniFolder" ): @@ -439,7 +443,7 @@ def to_1806(self): type["hidden"] = False -def to_1807(self): +def to_1807(context): for brain in api.portal.get_tool("portal_catalog")( portal_type="PrenotazioniFolder" ): @@ -452,3 +456,11 @@ def to_1807(self): logger.info( "Upgraded <{UID}>.notify_on_refuse_message value".format(UID=brain.UID) ) + + +def to_1808(context): + api.portal.get_tool("portal_workflow").updateRoleMappings() + + for brain in api.content.find(portal_type="Prenotazione"): + brain.getObject().reindexObjectSecurity() + logger.info("Upgraded <{UID}> security settings".format(UID=brain.UID)) diff --git a/src/redturtle/prenotazioni/upgrades.zcml b/src/redturtle/prenotazioni/upgrades.zcml index 912702ed..60b6e413 100644 --- a/src/redturtle/prenotazioni/upgrades.zcml +++ b/src/redturtle/prenotazioni/upgrades.zcml @@ -230,4 +230,18 @@ handler=".upgrades.to_1807" /> + + + +