Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
folix-01 committed Oct 19, 2023
1 parent 092f9ef commit 4bbcb30
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
4 changes: 0 additions & 4 deletions src/redturtle/prenotazioni/profiles/default/rolemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,5 @@
<role name="Bookings Manager" />
</permission>

<permission name="Review portal content" acquire="True">
<role name="Bookings Manager" />
</permission>

</permissions>
</rolemap>
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@
<permission-role>Reviewer</permission-role>
<permission-role>Bookings Manager</permission-role>
</permission-map>
<permission-map name="Review portal content" acquired="False">
<permission-role>Editor</permission-role>
<permission-role>Manager</permission-role>
<permission-role>Reviewer</permission-role>
<permission-role>Bookings Manager</permission-role>
</permission-map>
</state>
<state state_id="private" title="Private">
<description>Fake initial state, immediately changed</description>
Expand Down Expand Up @@ -56,6 +62,12 @@
<permission-role>Reader</permission-role>
<permission-role>Bookings Manager</permission-role>
</permission-map>
<permission-map name="Review portal content" acquired="False">
<permission-role>Editor</permission-role>
<permission-role>Manager</permission-role>
<permission-role>Reviewer</permission-role>
<permission-role>Bookings Manager</permission-role>
</permission-map>
</state>
<state state_id="confirmed" title="Confermato">
<exit-transition transition_id="refuse"/>
Expand All @@ -80,6 +92,12 @@
<permission-role>Reviewer</permission-role>
<permission-role>Bookings Manager</permission-role>
</permission-map>
<permission-map name="Review portal content" acquired="False">
<permission-role>Editor</permission-role>
<permission-role>Manager</permission-role>
<permission-role>Reviewer</permission-role>
<permission-role>Bookings Manager</permission-role>
</permission-map>
</state>
<state state_id="refused" title="Rifiutato">
<exit-transition transition_id="restore"/>
Expand All @@ -104,6 +122,12 @@
<permission-role>Reviewer</permission-role>
<permission-role>Bookings Manager</permission-role>
</permission-map>
<permission-map name="Review portal content" acquired="False">
<permission-role>Editor</permission-role>
<permission-role>Manager</permission-role>
<permission-role>Reviewer</permission-role>
<permission-role>Bookings Manager</permission-role>
</permission-map>
</state>
<transition transition_id="confirm" title="Conferma" new_state="confirmed" trigger="USER" before_script="" after_script="">
<action url="%(content_url)s/content_status_modify?workflow_action=confirm" category="workflow" icon="">Conferma</action>
Expand Down
2 changes: 1 addition & 1 deletion src/redturtle/prenotazioni/upgrades.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,6 @@ def to_1807(context):
def to_1808(context):
api.portal.get_tool("portal_workflow").updateRoleMappings()

for brain in api.portal.get_tool("portal_catalog")(portal_type="Prenotazione"):
for brain in api.content.find(portal_type="Prenotazione"):
brain.getObject().reindexObjectSecurity()
logger.info("Upgraded <{UID}> security settings".format(UID=brain.UID))

0 comments on commit 4bbcb30

Please sign in to comment.