On Mon, Jul 28, 2014 at 10:02 PM, Franz <[email protected]> wrote:
> Hi Jared,
>
> we need a similar solution. In our case, it's probably named "released"
> (instead of "signed"). The use-case is that nobody should change ticket
> properties when the ticket is released (only commenting).
>
> Have you created a Trac-Plugin on Trac-hacks [1] for that solution?
>
> Thank you,
> Franz
>
>
> [1] http://trac-hacks.org/
>
I had a similar requirement at my previous company so I've been thinking
about the implementation a bit more.
In that case, we would have liked to keep the existing resolutions and
perhaps had a "signed" status that followed "closed". It seems all that
would be necessary would be a minor change to Peter's plugin, to check
ticket['status'] rather than ticket['resolution'], and the rest could be
implemented in the workflow and with a special permission (see below). We'd
probably also want to have a workflow operation to get a ticket out of the
signed state, perhaps with another elevated permission for performing that
operation.
For your requirement of only allowing ticket commenting, you could probably
just tweak the ReadonlySignedTickets permissions policy to only allow
TICKET_APPEND rather than only allowing TICKET_VIEW when in the signed
state.
[extra-permissions]
_perms = TICKET_SIGN
[ticket-workflow]
sign = closed -> signed
sign.permissions = TICKET_SIGN
from trac.core import *
from trac.perm import IPermissionPolicy
from trac.ticket.model import Ticket
class ReadonlySignedTickets(Component):
implements(IPermissionPolicy)
def check_permission(self, action, username, resource, perm):
if resource is None or resource.realm != 'ticket' or \
resource.id is None or action == 'TICKET_VIEW' or \
action == 'TRAC_ADMIN' or 'TRAC_ADMIN' in perm:
return None
t = Ticket(self.env, resource.id)
if t['status'] == 'signed':
return False
--
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 http://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.