deprecate Transition.set_transition_permissions in favor of set_permissions (after all we know we're on a transition entity) stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 19 Feb 2010 09:37:03 +0100
branchstable
changeset 4645 fd4e32f17211
parent 4644 021035b9a7ab
child 4646 322c3dd96dd5
deprecate Transition.set_transition_permissions in favor of set_permissions (after all we know we're on a transition entity)
entities/wfobjs.py
--- a/entities/wfobjs.py	Fri Feb 19 09:36:26 2010 +0100
+++ b/entities/wfobjs.py	Fri Feb 19 09:37:03 2010 +0100
@@ -123,7 +123,7 @@
             self._cw.execute('SET S allowed_transition T '
                              'WHERE S eid %(s)s, T eid %(t)s',
                              {'s': state, 't': tr.eid}, ('s', 't'))
-        tr.set_transition_permissions(requiredgroups, conditions, reset=False)
+        tr.set_permissions(requiredgroups, conditions, reset=False)
         return tr
 
     def add_transition(self, name, fromstates, tostate=None,
@@ -221,8 +221,7 @@
             return self.transition_of[0].rest_path(), {}
         return super(Transition, self).after_deletion_path()
 
-    def set_transition_permissions(self, requiredgroups=(), conditions=(),
-                                   reset=True):
+    def set_permissions(self, requiredgroups=(), conditions=(), reset=True):
         """set or add (if `reset` is False) groups and conditions for this
         transition
         """
@@ -251,6 +250,11 @@
                              'T condition X WHERE T eid %(x)s',kwargs, 'x')
         # XXX clear caches?
 
+    @deprecated('[3.6.1] use set_permission')
+    def set_transition_permissions(self, requiredgroups=(), conditions=(),
+                                   reset=True):
+        return self.set_permissions(requiredgroups, conditions, reset)
+
 
 class Transition(BaseTransition):
     """customized class for Transition entities"""