Opened 15 years ago
Closed 15 years ago
#8884 closed defect (fixed)
TICKET_CREATE doesn't permit the state change
Reported by: | Owned by: | Remy Blank | |
---|---|---|---|
Priority: | high | Milestone: | 0.11.7 |
Component: | ticket system | Version: | 0.11.4 |
Severity: | critical | Keywords: | |
Cc: | massimiliano.bernabe@…, Eli Carter | Branch: | |
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description (last modified by )
trac.ini:
... reopen = closed -> reopened reopen.permissions = TICKET_CREATE reopen.operations = del_resolution ...
We set permissions for every authenticated user, and with above configuration (coming from the official examples) users with only TICKET_CREATE permission are not able to reopen any ticket. The system response is "Warning: No permission to change ticket fields." "Changed by guest status changed from closed to reopened resolution risolto deleted"
The only way to make endusers able to reopen a ticket, is to give them the TICKET_CHGPROP permission, but then they are able to change every properties any time and we don't want to give them this possibility.
Attachments (3)
Change History (19)
comment:1 by , 15 years ago
Description: | modified (diff) |
---|---|
Milestone: | → 0.12 |
Owner: | set to |
comment:2 by , 15 years ago
Currently, modifying the state of a ticket requires either TICKET_APPEND
or TICKET_CHGPROP
. I could probably work around this, but I'm not sure it's a good idea. Does it really make sense to allow someone to re-open a ticket, but to prevent her from adding a comment as to why she did?
So I suggest a "worksforme" with the suggestion to add the TICKET_APPEND
permission to your users.
comment:3 by , 15 years ago
Perhaps i didn't explain very well the problem: i have some external users that i need to enable just to create and reopen ticket. So, I gave them the TICKET_VIEW, TICKET_CREATE, TICKET_APPEND permissions but with only these permissions they are not able to reopen a ticket because trac system notify they are not enable to change the ticket properties (i think state and maybe the resolution description)
follow-up: 5 comment:4 by , 15 years ago
Ah, sorry, I should have checked that. Indeed, even with TICKET_APPEND
, it's not possible to re-open a closed ticket. And you are correct, changing any properties (including status and resolution) currently require TICKET_MODIFY
.
comment:5 by , 15 years ago
follow-up: 7 comment:6 by , 15 years ago
Cc: | added |
---|
Mmh, it's even worse than I thought. If a user has TICKET_CHGPROP
, but is not allowed to change the status according to the workflow, she can bypass the workflow by crafting a special ticket page in the browser (e.g. with FireBug) including a field_status
field. I assume the same applies to the resolution
field. For example, to close a ticket:
<input name="field_status" value="closed" type="hidden"/>
I wonder if we shouldn't disallow direct changes to the status
and resolution
fields, and only allow that from the workflow.
Eli, could please you comment on that?
comment:7 by , 15 years ago
Replying to rblank:
Mmh, it's even worse than I thought. If a user has
TICKET_CHGPROP
, but is not allowed to change the status according to the workflow, she can bypass the workflow by crafting a special ticket page in the browser (e.g. with FireBug) including afield_status
field. I assume the same applies to theresolution
field. For example, to close a ticket:
Oh, that's not good. And I think we need to fix that in 0.11-stable as well as trunk.
by , 15 years ago
Attachment: | 8884-workflow-fixes-r8952.patch added |
---|
Fix for both issues (direct change to status and re-opening with TICKET_CREATE
and TICKET_APPEND
).
comment:8 by , 15 years ago
The patch above (against trunk) fixes the two issues, plus an additional related one:
- A user having
TICKET_APPEND
andTICKET_CREATE
can now reopen a closed ticket with the default workflow. - The
status
andresolution
fields cannot be changed directly anymore (and neither cantime
andchangetime
). - The initial status for new tickets is forced to
new
, something that was previously done through a hidden<input>
.
Ok to apply? Eli?
(I can backport the change to 0.11-stable if desired)
follow-up: 11 comment:9 by , 15 years ago
Patch looks good, two remarks though:
- as you have
workflow_fields = ('resolution', 'status', 'time', 'changetime')
,time
andchangetime
are not really workflow fields, so maybe rather useprotected_fields
terminology? (orprogrammatic_fields
?), and# Fields that can't be modified directly by the user
. - as you talk about 0.11-stable, remember the possible Python 2.3 breakage when replacing
dict([])
vs.dict(genexpr)
;-)
comment:10 by , 15 years ago
first of all thanks for working on the ticket so quickly, then … maybe i didn't understand well the patch:
it would be useful (ate least for me) to be able to differently address the new tickets from the reopened ones, so i thought to define workflow as
… reopen = closed → reopened
or changing resolution (and then useing it in specific reports)
… reopen.operations = set_resolution reopen.set_resolution = riaperto
does this patch let me do this?
comment:11 by , 15 years ago
Replying to cboos:
- as you talk about 0.11-stable, remember the possible Python 2.3 breakage when replacing
dict([])
vs.dict(genexpr)
;-)
Mmh… I'm sure I would have thought of that ;-)
Replying to anonymous:
does this patch let me do this?
The resolution
field should be empty for tickets that are not closed, so I'm not sure you will be able to do what you describe. But at least people with TICKET_CREATE
will be able to reopen tickets (as advertised).
by , 15 years ago
Attachment: | 8884-workflow-fixes-r8981.patch added |
---|
Updated with feedback from this ticket and IRC.
comment:12 by , 15 years ago
The patch above integrates the feedback in comment:9 (except for an import of set
for Python 2.3). It also makes the permission checks more explicit, instead of using an opaque cnt
variable for counting allowed permissions.
comment:14 by , 15 years ago
Thanks for the review, Eli! Patch applied in [8982]. I'm working on the 0.11-stable backport (the patch doesn't apply cleanly).
comment:15 by , 15 years ago
The patch above is a backport to 0.11-stable. Unfortunately, my Python 2.3 installation seems to be broken at the moment, so I would be grateful if somebody could test the patch on 2.3 (2.6 works fine).
comment:16 by , 15 years ago
Milestone: | 0.12 → 0.11.7 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Backport tested on 2.3 and applied in [8993].
Verified on trunk.