Added role for templates managers
authorThierry Florac <thierry.florac@onf.fr>
Wed, 12 Jul 2017 11:43:19 +0200
changeset 102 58cde0290f69
parent 101 0ec0c7bee139
child 103 8627e24b348e
Added role for templates managers
src/pyams_content/root/__init__.py
src/pyams_content/root/interfaces/__init__.py
--- a/src/pyams_content/root/__init__.py	Wed Jul 12 11:42:15 2017 +0200
+++ b/src/pyams_content/root/__init__.py	Wed Jul 12 11:43:19 2017 +0200
@@ -18,6 +18,7 @@
 # import standard library
 
 # import interfaces
+from pyams_content.interfaces import WEBMASTER_ROLE, OPERATOR_ROLE
 from pyams_content.root.interfaces import ISiteRootRoles, ISiteRootConfiguration, ISiteRoot, \
     ISiteRootToolsConfiguration, ISiteRootBackOfficeConfiguration
 from pyams_portal.interfaces import IPortalContext
@@ -56,13 +57,14 @@
 class SiteRoot(ProtectedObject, BaseSiteRoot, UserSkinnableContent):
     """Main site root"""
 
-    __roles__ = ('system.Manager', 'pyams.Webmaster', 'pyams.Operator')
+    __roles__ = ('system.Manager', WEBMASTER_ROLE, OPERATOR_ROLE, 'pyams.TemplatesManager')
 
     roles_interface = ISiteRootRoles
 
     managers = RolePrincipalsFieldProperty(ISiteRootRoles['managers'])
     webmasters = RolePrincipalsFieldProperty(ISiteRootRoles['webmasters'])
     operators = RolePrincipalsFieldProperty(ISiteRootRoles['operators'])
+    templates_managers = RolePrincipalsFieldProperty(ISiteRootRoles['templates_managers'])
 
 
 @implementer(ISiteRootConfiguration)
--- a/src/pyams_content/root/interfaces/__init__.py	Wed Jul 12 11:42:15 2017 +0200
+++ b/src/pyams_content/root/interfaces/__init__.py	Wed Jul 12 11:43:19 2017 +0200
@@ -41,6 +41,10 @@
                                role_id='pyams.Webmaster',
                                required=False)
 
+    templates_managers = PrincipalsSet(title=_("Templates managers"),
+                                       role_id='pyams.TemplatesManager',
+                                       required=False)
+
     operators = Principal(title=_("Operators group"),
                           description=_("Name of group containing all roles owners"),
                           role_id='pyams.Operator',