# HG changeset patch # User Sylvain Thénault # Date 1266568623 -3600 # Node ID fd4e32f172118b7222a8d9eba031712fc2e0be76 # Parent 021035b9a7ab39f9bae67fe732734b99fee695ee deprecate Transition.set_transition_permissions in favor of set_permissions (after all we know we're on a transition entity) diff -r 021035b9a7ab -r fd4e32f17211 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"""