Edgewall Software
Modify

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#11850 closed defect (fixed)

Permission and new state for _reset action can't be customized

Reported by: Ryan J Ollos Owned by: Ryan J Ollos
Priority: normal Milestone: 1.0.3
Component: ticket system Version:
Severity: normal Keywords: workflow
Cc: Branch:
Release Notes:

The special _reset action can be redefined in the [ticket-workflow] section of trac.ini.

API Changes:
  • The get_all_actions method of the ConfigurableTicketWorkflow class returns a dictionary of the actions defined in the configuration as well as implicit actions such as the default _reset action.
  • Added to_list function to trac.util, for parsing a string and returning a list.
Internal Changes:

Description

If a _reset action is provided through the [ticket-workflow], the required permissions will still be restricted to TICKET_ADMIN and the new state will always be new. In the following example the ticket would be reset to new rather than needs_triage and only a user with TICKET_ADMIN would be able to reset the ticket:

_reset = -> needs_triage
_reset.operations = reset_workflow
_reset.name = reset
_reset.permissions =

Further, the hint in the workflow dialog will be incorrect:

The problematic code is:

The default _reset action and the reset_workflow operation were added in #5307.

Attachments (2)

InvalidState.png (24.4 KB ) - added by Ryan J Ollos 6 years ago.
6e2e45f90d284196ab432645135b1ffb7c6afbf8.zip (9.9 KB ) - added by Jun Omae 6 years ago.

Download all attachments as: .zip

Change History (11)

by Ryan J Ollos, 6 years ago

Attachment: InvalidState.png added

comment:1 by Ryan J Ollos, 6 years ago

Proposed changes in log:rjollos.git:t11850-custom-reset-action.1.

Additions to workflow documentation in TracWorkflow@62.

comment:2 by Ryan J Ollos, 6 years ago

Status: newassigned

comment:3 by Ryan J Ollos, 6 years ago

API Changes: modified (diff)
Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Committed to 1.0-stable in [13420], merged to trunk in [13421:13422].

Last edited 6 years ago by Ryan J Ollos (previous) (diff)

comment:4 by Ryan J Ollos, 6 years ago

The changes introduced a defect that was fixed on 1.0-stable in [13425], merged to trunk in [13426].

I've tried improving things in log:rjollos.git:t11850-custom-reset-action.2, although there is risk that it's overly complex.

in reply to:  4 comment:5 by Jun Omae, 6 years ago

I've tried improving things in log:rjollos.git:t11850-custom-reset-action.2, although there is risk that it's overly complex.

RegressionTestTicket6747 fails with KeyError: u'set_owner' on the branch. See 6e2e45f90d284196ab432645135b1ffb7c6afbf8.zip.

comment:6 by Ryan J Ollos, 6 years ago

[6e2e45f9/rjollos.git] isn't intended to be committed on 1.0-stable which is why the tests fails (log message say the changes are only intended for the trunk). I was being lazy and should have posted a second branch based on the trunk.

I'm not happy with the changes though and plan to rework them entirely.

comment:7 by Ryan J Ollos, 6 years ago

API Changes: modified (diff)

Refactoring on 1.0-stable in [13441], on trunk in [13442:13443].

comment:8 by Ryan J Ollos, 6 years ago

Simplified refactoring committed in [13444] and merged in [13445]. Documentation updated in TracWorkflow@63.

comment:9 by Ryan J Ollos, 6 years ago

Release Notes: modified (diff)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Ryan J Ollos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.