I did not post the entire workflow in my original email, only the workflow sufficient for a ticket in the "new" state. I definitely have states to move tickets out of accepted and any other state.
On Thursday, November 20, 2014 10:34:21 AM UTC-5, RjOllos wrote: > > > First a side note. Your "new_accepted" action seems to be a "dead-end". > You don't show any actions that could move your ticket out of the accepted > state. Insert [[Workflow]] into a wiki page and you can see that there are > no transitions out of the accepted state with your workflow. There also > aren't any actions to move a ticket out of the closed state, e.g. reopen. > Thanks a lot for the permission policy. I will take a look at it and see how it works out. On Thursday, November 20, 2014 10:34:21 AM UTC-5, RjOllos wrote: > With the permission policy I'll propose, you'll need to define additional > workflow actions that would allow someone with higher permissions to deal > with tickets that don't have an owner, or have an owner that won't do any > work on the ticket. That is, unless you've configured your system to avoid > every one of these situations. For example, you may want to also allow > someone with TICKET_ADMIN to perform all the workflow action. Just append > TICKET_ADMIN to the permissions attribute of each workflow action you want > to allow, e.g. > > new_reassign.permissions = TICKET_CHANGE_STATE, TICKET_ADMIN > > To implement the permissions policy: > > Add RestrictTicketActionsPolicy to the permission_policies in the [trac] > section of trac.ini: permission_policies = RestrictTicketActions, > DefaultPermissionPolicy, LegacyAttachmentPolicy > > If you are using finer-grained policies such as AuthzPolicy, they may need > to go before RestrictTicketActions. > > Grant TICKET_CHANGE_STATE to users that should be able to change the > states of tickets that they own. This might be all authenticated users. > > > Copy the following into a file named restrict_actions.py in your > environment or shared plugins directory: > > # -*- coding: utf-8 -*- > # > # Copyright (C) 2014 Edgewall Software > # All rights reserved. > # > # This software is licensed as described in the file COPYING, which > # you should have received as part of this distribution. The terms > # are also available at http://trac.edgewall.org/wiki/TracLicense. > # > # This software consists of voluntary contributions made by many > # individuals. For the exact contribution history, see the revision > # history and logs, available at http://trac.edgewall.org/log/. > > from trac.core import * > from trac.perm import IPermissionPolicy, IPermissionRequestor > from trac.ticket.model import Ticket > > > class RestrictTicketActionsPolicy(Component): > """Provides a permission for restricting ticket actions to the > ticket owner. > """ > > implements(IPermissionPolicy, IPermissionRequestor) > > # IPermissionRequestor methods > > def get_permission_actions(self): > return ['TICKET_CHANGE_STATE'] > > # IPermissionPolicy methods > > def check_permission(self, action, username, resource, perm): > if action == 'TICKET_CHANGE_STATE' \ > and resource is not None \ > and resource.realm == 'ticket' \ > and resource.id is not None: > ticket = Ticket(self.env, resource.id) > return ticket['owner'] == username > return None > > > > > > -- 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.
