Use role name constant
authorThierry Florac <thierry.florac@onf.fr>
Wed, 04 Oct 2017 10:43:58 +0200
changeset 195 e689a4341d47
parent 194 6a26b2b0cb47
child 196 30b26a44e4ae
Use role name constant
src/pyams_content/workflow/__init__.py
--- a/src/pyams_content/workflow/__init__.py	Tue Oct 03 15:48:44 2017 +0200
+++ b/src/pyams_content/workflow/__init__.py	Wed Oct 04 10:43:58 2017 +0200
@@ -19,7 +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.interfaces import WEBMASTER_ROLE, PILOT_ROLE, MANAGER_ROLE, OWNER_ROLE, READER_ROLE
 from pyams_content.shared.common.interfaces import IWfSharedContentRoles, IManagerRestrictions
 from pyams_content.workflow.interfaces import IContentWorkflow
 from pyams_security.interfaces import IRoleProtectedObject
@@ -248,7 +248,7 @@
     """Remove readers when a content is archived"""
     roles = IWfSharedContentRoles(context, None)
     if roles is not None:
-        IRoleProtectedObject(context).revoke_role('pyams.Reader', roles.readers)
+        IRoleProtectedObject(context).revoke_role(READER_ROLE, roles.readers)
 
 
 def clone_action(wf, context):