[Zope3-checkins] SVN: Zope3/branches/jack-e_interfacebased_workflow/src/zope/app/workflow/stateful/interfaces.py More interfaces. It's probably time to refactore all this component and start to rewrite a bit

Julien Anguenot ja at nuxeo.com
Wed Oct 13 17:01:34 EDT 2004


Log message for revision 28134:
   More interfaces. It's probably time to refactore all this component and start to rewrite a bit

Changed:
  U   Zope3/branches/jack-e_interfacebased_workflow/src/zope/app/workflow/stateful/interfaces.py

-=-
Modified: Zope3/branches/jack-e_interfacebased_workflow/src/zope/app/workflow/stateful/interfaces.py
===================================================================
--- Zope3/branches/jack-e_interfacebased_workflow/src/zope/app/workflow/stateful/interfaces.py	2004-10-13 21:00:37 UTC (rev 28133)
+++ Zope3/branches/jack-e_interfacebased_workflow/src/zope/app/workflow/stateful/interfaces.py	2004-10-13 21:01:32 UTC (rev 28134)
@@ -35,7 +35,6 @@
 MANUAL = u'Manual'
 INITIAL = u'INITIAL'
 
-
 class ITransitionEvent(IWorkflowEvent):
     """An event that signalizes a transition from one state to another."""
 
@@ -49,12 +48,10 @@
                               contains all the specific information, such as
                               source and destination state.""")
 
-
 class IBeforeTransitionEvent(ITransitionEvent):
     """This event is published before a the specified transition occurs. This
     allows other objects to veto the transition."""
 
-
 class IAfterTransitionEvent(ITransitionEvent):
     """This event is published after the transition. This is important for
     objects that might change permissions when changing the status."""
@@ -71,6 +68,42 @@
         default=None,
         required=False)
 
+    #
+    # Permissions / Roles
+    #
+
+    #permissionRoles = zope.schema.Dict(
+    #    title=_(u"Permission Roles mapping"),
+    #    description=_(u"This is the permission roles mapping"
+    #                  u"this given state."),
+    #    required=False)
+
+    #
+    # API for permissions / roles
+    # DCWorkflow style
+    #
+
+    def getProcessDefinitionPermissions(self):
+        """Returns the list of permissions defined on the process
+        definition
+        """
+
+    def getPermissionInfo(p):
+        """Get the  permission info from the mapping defined on the state
+        """
+
+    def getPermissionRolesMapping():
+        """Return the permissions role mapping
+        """
+
+    def setPermissionsRolesMapping(mapping):
+        """Set the permissions roles mapping
+        """
+
+    def getRelevantRoles():
+        """returns all the roles subscribed in z3
+        """
+
 class IStatefulStatesContainer(IProcessDefinitionElementContainer):
     """Container that stores States."""
 
@@ -79,16 +112,12 @@
 
     __setitem__.precondition = ItemTypePrecondition(IState)
 
-
-
 class IStateContained(IContained):
     """Interface for state of a stateful workflow process definition."""
 
     __parent__ = zope.schema.Field(
              constraint = ContainerTypesConstraint(IStatefulStatesContainer))
 
-
-
 class ITransition(Interface):
     """Stateful workflow transition."""
 
@@ -131,7 +160,6 @@
     def getProcessDefinition():
         """Return the ProcessDefinition Object."""
 
-
 class IStatefulTransitionsContainer(IProcessDefinitionElementContainer):
     """Container that stores Transitions."""
 
@@ -140,17 +168,13 @@
 
     __setitem__.precondition = ItemTypePrecondition(ITransition)
 
-
-
 class ITransitionContained(IContained):
-    """Stateful workflow transition that lives in a StatefulTansitionsContainer."""
+    """Stateful workflow transition that lives in a
+    StatefulTansitionsContainer."""
 
     __parent__ = zope.schema.Field(
-             constraint = ContainerTypesConstraint(IStatefulTransitionsContainer))
+        constraint = ContainerTypesConstraint(IStatefulTransitionsContainer))
 
-
-
-
 class IStatefulProcessDefinition(IProcessDefinition):
     """Interface for stateful workflow process definition."""
 
@@ -166,6 +190,9 @@
 
     transitions = Attribute("Transition objects container.")
 
+    processPermissions = Attribute("Relevant permissions for the process "
+                                   "definition")
+
     def addState(name, state):
         """Add a IState to the process definition."""
 
@@ -199,8 +226,21 @@
     def clear():
         """Clear the whole ProcessDefinition."""
 
+    def addProcessPermission(p):
+        """Add a process permission
+        """
 
+    def delProcessPermission(p):
+        """Del a process permission
+        """
 
+    def getProcessPermissions():
+        """Returns the process permissions"""
+
+    def getAvailablePermissions():
+        """Returns the permissions we may within this process definition
+        """
+
 class IStatefulPIAdapter(IPIAdapter):
     """Workflow process instance Adapter.
 
@@ -240,7 +280,6 @@
     def getInterfacesForProcessName(name):
         """Return a list of interfaces for the particular process name."""
 
-
 class IContentWorkflowsManager(IContentProcessRegistry):
     """A Content Workflows Manager.
 
@@ -262,3 +301,25 @@
 
     kwargs = Attribute('Mapping containing information coming from the form')
     form_action = Attribute('Form action')
+
+####################################################################
+
+class IProcessDefinitionAddPermissionsEvent(IObjectEvent):
+    """Process Definition Add Permissions Event interface
+    """
+    permissions_to_add = Attribute("Permission to add the process definition")
+
+class IProcessDefinitionDelPermissionsEvent(IObjectEvent):
+    """Process Definition Dell Permissions Event interface
+    """
+    permissions_to_remove = Attribute("Permission to add the process"
+                                      "definition")
+
+####################################################################
+
+class IStatePermissionsRolesMappingUpdateEvent(IObjectEvent):
+    """State Permissions Roles Mapping Update interface
+    """
+    mapping = Attribute("The actual mapping containing permissions role")
+
+####################################################################



More information about the Zope3-Checkins mailing list