[Cubicweb] Change workflow's permissions with migration script
carlos.balderas at gmail.com
Tue Apr 19 05:07:34 CEST 2011
Thank you very much for your answer, that solved my question.
On Mon, Apr 18, 2011 at 12:45 AM, Adrien Di Mascio <
adrien.dimascio at logilab.fr> wrote:
> Hi Carlos,
> On 17/04/2011 18:01, Carlos Balderas wrote:
>> I would like to change permissions on a workflow , I tried changing the
>> permissions in the postcreate file, where the workflow was created and
>> then make a migration script with "sync_schema_props_perms()"
>> instruction, but after upgrading my instance, this doesn't seem to work.
> sync_schema_props_perms() will synchronize schema objects (entity and
> relation types / definitions). The workflow is an application object and
> not part of the schema itself.
> If you want to change transition permissions, you should probably use the
> ``set_permissions()`` method of Transition entities. For instance :
> >>> rset = rql('Any T WHERE T is Transition, T name "the-transition"')
> >>> transition = rset.get_entity(0, 0)
> >>> transition.set_permissions(required_groups, optional_conditions)
> where ``required_groups`` and ``optional_conditions`` are the same
> parameters as the ones used in your postcreate.py script.
> Adrien Di Mascio - LOGILAB, Paris (France).
> Tél: 01.45.32.03.12
> Formations - http://www.logilab.fr/formations
> Développements - http://www.logilab.fr/services
> Gestion de connaissances - http://www.cubicweb.org/
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Cubicweb