Use role names constants
authorThierry Florac <thierry.florac@onf.fr>
Tue, 12 Sep 2017 11:17:18 +0200
changeset 143 6025b1e431bf
parent 142 03120ac26f6b
child 144 b0203f9816a6
Use role names constants
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)