Updated shared tools interfaces
authorThierry Florac <tflorac@ulthar.net>
Sun, 26 Nov 2017 09:53:31 +0100
changeset 285 e10f82e4874e
parent 284 796b6f241aff
child 286 1a27b43375d6
Updated shared tools interfaces
src/pyams_content/shared/common/interfaces/__init__.py
--- a/src/pyams_content/shared/common/interfaces/__init__.py	Sun Nov 26 09:52:59 2017 +0100
+++ b/src/pyams_content/shared/common/interfaces/__init__.py	Sun Nov 26 09:53:31 2017 +0100
@@ -33,6 +33,32 @@
 from pyams_content import _
 
 
+class IBaseContentManagerRoles(Interface):
+    """Shared tool roles interface"""
+
+    webmasters = PrincipalsSet(title=_("Webmasters"),
+                               description=_("Webmasters can handle all contents, including published ones"),
+                               role_id=WEBMASTER_ROLE,
+                               required=False)
+
+    pilots = PrincipalsSet(title=_("Pilots"),
+                           description=_("Pilots can handle tool configuration, manage access rules, grant users "
+                                         "roles and manage managers restrictions"),
+                           role_id=PILOT_ROLE,
+                           required=False)
+
+    managers = PrincipalsSet(title=_("Managers"),
+                             description=_("Managers can handle main operations in tool's workflow, like publish "
+                                           "or retire contents"),
+                             role_id=MANAGER_ROLE,
+                             required=False)
+
+    contributors = PrincipalsSet(title=_("Contributors"),
+                                 description=_("Contributors are users which are allowed to create new contents"),
+                                 role_id=CONTRIBUTOR_ROLE,
+                                 required=False)
+
+
 class ISharedSite(IBaseContent):
     """Shared site interface"""
 
@@ -66,30 +92,8 @@
     shared_content_factory = Attribute("Shared data factory")
 
 
-class ISharedToolRoles(Interface):
-    """Shared tool roles interface"""
-
-    webmasters = PrincipalsSet(title=_("Webmasters"),
-                               description=_("Webmasters can handle all contents, including published ones"),
-                               role_id=WEBMASTER_ROLE,
-                               required=False)
-
-    pilots = PrincipalsSet(title=_("Pilots"),
-                           description=_("Pilots can handle tool configuration, manage access rules, grant users "
-                                         "roles and manage managers restrictions"),
-                           role_id=PILOT_ROLE,
-                           required=False)
-
-    managers = PrincipalsSet(title=_("Managers"),
-                             description=_("Managers can handle main operations in tool's workflow, like publish "
-                                           "or retire contents"),
-                             role_id=MANAGER_ROLE,
-                             required=False)
-
-    contributors = PrincipalsSet(title=_("Contributors"),
-                                 description=_("Contributors are users which are allowed to create new contents"),
-                                 role_id=CONTRIBUTOR_ROLE,
-                                 required=False)
+class ISharedToolRoles(IBaseContentManagerRoles):
+    """Shared tool roles"""
 
 
 class IWfSharedContent(IBaseContent):
@@ -216,3 +220,6 @@
 
     def set_restrictions(self, principal, restrictions):
         """Set manager restrictions for given principal"""
+
+    def drop_restrictions(self, principal):
+        """Drop manager restrictions for given principal"""