Hi,

the adapted Python plugin (from this "readonly ticket hack" works very well 
and exactly as intended!

Thank you so much for helping me out w/ all this Python!


regards,
Florian


Am Freitag, 17. März 2017 19:42:02 UTC+1 schrieb Peter Suter:
>
> On 17.03.2017 19:32, Peter Suter wrote:
>
> Hello
>
> On 17.03.2017 16:31, Florian Schricker wrote:
>
> Hello everybody, 
>
>
> I recently got a request whether it is possible to setup the permissions 
> in a ticket workflow that when somebody issues an action "edit" on a ticket 
> it is changed into a state "editing" where only the current owner can 
> actually edit the ticket description.
>
> Is this at all possible - maybe with the help of ReadonlyTickets hack as a 
> basis?
>
>
> It reminds me of this: 
> https://trac.edgewall.org/wiki/CookBook/Configuration/SignedTickets
>
> (I only now saw that this was you, too.)
>
> (Is that what you meant by ReadonlyTickets hack?)
> It sounds like it should be possible to adjust that here and there to get 
> what you describe:
>
> [ticket-workflow]edit = new,assigned,accepted,reopened -> 
> editingsign.operations = set_owner_to_self
>
> I meant: edit.operations = set_owner_to_self
>
> # -*- coding: utf-8 -*-
> from trac.core import *from trac.perm import IPermissionPolicyfrom 
> trac.ticket.model import Ticket
>
> class ReadonlyEditingTickets(Component):
>
>     implements(IPermissionPolicy)
>
>     allowed_actions = ('TICKET_VIEW',)
>
>     def check_permission(self, action, username, resource, perm):
>         if resource is None or resource.realm != 'ticket' or \
>                 resource.id is None or \
>                 action in self.allowed_actions:
>             return None
>
>         t = Ticket(self.env, resource.id)
>         if t['status'] == 'editing' and t['owner'] != username:
>             return False
>
>
> [trac]permission_policies = ReadonlyEditingTickets, ...
>
> Regards,
> Peter
>
>
>

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to