# HG changeset patch # User Thierry Florac # Date 1505207838 -7200 # Node ID 6025b1e431bfed4b9fde4fdffa9955e706aabf22 # Parent 03120ac26f6b44b57fd03b28ce7cb2678cd462f5 Use role names constants diff -r 03120ac26f6b -r 6025b1e431bf src/pyams_content/workflow/__init__.py --- a/src/pyams_content/workflow/__init__.py Mon Sep 11 15:10:50 2017 +0200 +++ b/src/pyams_content/workflow/__init__.py Tue Sep 12 11:17:18 2017 +0200 @@ -19,6 +19,7 @@ # import interfaces from pyams_content.interfaces import MANAGE_SITE_ROOT_PERMISSION, MANAGE_CONTENT_PERMISSION, \ PUBLISH_CONTENT_PERMISSION, CREATE_CONTENT_PERMISSION +from pyams_content.interfaces import WEBMASTER_ROLE, PILOT_ROLE, MANAGER_ROLE, OWNER_ROLE from pyams_content.shared.common.interfaces import IWfSharedContentRoles, IManagerRestrictions from pyams_content.workflow.interfaces import IContentWorkflow from pyams_security.interfaces import IRoleProtectedObject @@ -284,7 +285,7 @@ history_label=_("Publication request"), next_step=_("content managers authorized to take charge of your content are going to " "be notified of your request."), - notify_roles={'pyams.Webmaster', 'pyams.Pilot', 'pyams.Manager', 'pyams.Owner'}, + notify_roles={WEBMASTER_ROLE, PILOT_ROLE, MANAGER_ROLE, OWNER_ROLE}, notify_message=_("A publication request has been submitted for content « {0} »"), order=1) @@ -299,7 +300,7 @@ history_label=_("Publication request"), next_step=_("content managers authorized to take charge of your content are going to " "be notified of your request."), - notify_roles={'pyams.Webmaster', 'pyams.Pilot', 'pyams.Manager', 'pyams.Owner'}, + notify_roles={WEBMASTER_ROLE, PILOT_ROLE, MANAGER_ROLE, OWNER_ROLE}, notify_message=_("A new publication request has been submitted for content « {0} »"), order=1) @@ -312,7 +313,7 @@ menu_css_class='fa fa-fw fa-mail-reply', view_name='wf-cancel-propose.html', history_label=_("Publication request canceled"), - notify_roles={'pyams.Webmaster', 'pyams.Pilot', 'pyams.Manager', 'pyams.Owner'}, + notify_roles={WEBMASTER_ROLE, PILOT_ROLE, MANAGER_ROLE, OWNER_ROLE}, notify_message=_("The publication request for content « {0} » has been cancelled"), order=2) @@ -341,7 +342,7 @@ menu_css_class='fa fa-fw fa-thumbs-o-down', view_name='wf-refuse.html', history_label=_("Publication refused"), - notify_roles={'pyams.Owner'}, + notify_roles={OWNER_ROLE}, notify_message=_("The publication request for content « {0} » has been refused"), order=3) @@ -385,7 +386,7 @@ history_label=_("Retire request"), next_step=_("content managers authorized to take charge of your content are going " "to be notified of your request."), - notify_roles={'pyams.Webmaster', 'pyams.Pilot', 'pyams.Manager', 'pyams.Owner'}, + notify_roles={WEBMASTER_ROLE, PILOT_ROLE, MANAGER_ROLE, OWNER_ROLE}, notify_message=_("A retire request has been submitted for content « {0} »"), order=7) @@ -405,7 +406,7 @@ menu_css_class='fa fa-fw fa-mail-reply', view_name='wf-cancel-retiring.html', history_label=_("Retire request canceled"), - notify_roles={'pyams.Webmaster', 'pyams.Pilot', 'pyams.Manager', 'pyams.Owner'}, + notify_roles={WEBMASTER_ROLE, PILOT_ROLE, MANAGER_ROLE, OWNER_ROLE}, notify_message=_("The retiring request for content « {0} » has been cancelled"), order=8) @@ -418,7 +419,7 @@ menu_css_class='fa fa-fw fa-stop', view_name='wf-retire.html', history_label=_("Content retired"), - notify_roles={'pyams.Webmaster', 'pyams.Pilot', 'pyams.Manager', 'pyams.Owner'}, + notify_roles={WEBMASTER_ROLE, PILOT_ROLE, MANAGER_ROLE, OWNER_ROLE}, notify_message=_("The content « {0} » has been retired"), order=9) @@ -432,7 +433,7 @@ history_label=_("Archive request"), next_step=_("content managers authorized to take charge of your content are going to " "be notified of your request."), - notify_roles={'pyams.Webmaster', 'pyams.Pilot', 'pyams.Manager', 'pyams.Owner'}, + notify_roles={WEBMASTER_ROLE, PILOT_ROLE, MANAGER_ROLE, OWNER_ROLE}, notify_message=_("An archive request has been submitted for content « {0} »"), order=10) @@ -445,7 +446,7 @@ menu_css_class='fa fa-fw fa-mail-reply', view_name='wf-cancel-archiving.html', history_label=_("Archive request canceled"), - notify_roles={'pyams.Webmaster', 'pyams.Pilot', 'pyams.Manager', 'pyams.Owner'}, + notify_roles={WEBMASTER_ROLE, PILOT_ROLE, MANAGER_ROLE, OWNER_ROLE}, notify_message=_("The archive request for content « {0} » has been cancelled"), order=11) @@ -459,7 +460,7 @@ menu_css_class='fa fa-fw fa-archive', view_name='wf-archive.html', history_label=_("Content archived"), - notify_roles={'pyams.Webmaster', 'pyams.Pilot', 'pyams.Manager', 'pyams.Owner'}, + notify_roles={WEBMASTER_ROLE, PILOT_ROLE, MANAGER_ROLE, OWNER_ROLE}, notify_message=_("The content « {0} » has been archived"), order=12)