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
(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 -> editing
sign.operations = set_owner_to_self
# -*- coding: utf-8 -*-
from trac.core import *
from trac.perm import IPermissionPolicy
from 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.