[Cubicweb] Change workflow's permissions with migration script

Carlos Balderas carlos.balderas at gmail.com
Tue Apr 19 05:07:34 CEST 2011


Hi Adrien,

Thank you very much for your answer, that solved my question.

Best Regards
Carlos Balderas


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...
URL: <http://lists.cubicweb.org/pipermail/cubicweb/attachments/20110418/6ffdb3f1/attachment.htm>


More information about the Cubicweb mailing list