Edgewall Software
Modify

Opened 11 months ago

Closed 6 weeks ago

#13093 closed enhancement (fixed)

TICKET_EDIT_CC apply to new ticket

Reported by: knavero@… Owned by: Ryan J Ollos
Priority: normal Milestone: 1.3.6
Component: ticket system Version:
Severity: normal Keywords:
Cc: Branch:
Release Notes:

TICKET_EDIT_CC is required for editing the CC list as a text field for the new ticket form.

API Changes:

Description

Can TICKET_EDIT_CC apply to creation of a new ticket also? In other words, it would be nice to limit the control of how a user submitting a ticket can send a lot of emails

Attachments (0)

Change History (5)

comment:1 by Jun Omae, 11 months ago

Component: generalticket system
Milestone: next-stable-1.2.x

Sounds good. I've considered the same when a spammer cloned old tickets which have many entries in the cc field.

comment:2 by Peter Suter, 11 months ago

Since Trac 1.3.3 (#12947) you can presumably do this by disabling the DefaultTicketPolicy component. When that component is enabled four rules are enabled:

  • Users with MILESTONE_VIEW can edit the ticket milestone field.
  • Authenticated users with TICKET_APPEND or TICKET_CHGPROP can edit the description of a ticket they reported.
  • Authenticated users with TICKET_APPEND can edit their own ticket comments.
  • The CC field can be edited when creating a ticket even if the user doesn't have TICKET_EDIT_CC.

Disabling the component will disable all four rules. To disable only the last rule, I guess you can replace the component in a single-file-plugin (untested):

from trac.core import *
from trac.ticket.web_ui import DefaultTicketPolicy

class DefaultTicketPolicyWithoutNewTicketEditCc(DefaultTicketPolicy):

    def check_permission(self, action, username, resource, perm):
        # Skip DefaultTicketPolicy rule for TICKET_EDIT_CC
        if action == 'TICKET_EDIT_CC':
            return
        super(DefaultTicketPolicyWithoutNewTicketEditCc, self) \
            .check_permission(action, username, resource, perm)

This could be added to wiki:CookBook/PermissionPolicies.

(But I don't mind if this is changed in Trac itself anyway. Then a cookbook recipe could show how to get the old behavior.)

comment:3 by Ryan J Ollos, 6 weeks ago

Milestone: next-stable-1.2.x1.3.6
Owner: set to Ryan J Ollos
Release Notes: modified (diff)
Status: newassigned

Proposed changes in [78a9731d7/rjollos.git].

in reply to:  3 comment:4 by Jun Omae, 6 weeks ago

The changes look good to me.

comment:5 by Ryan J Ollos, 6 weeks ago

Resolution: fixed
Status: assignedclosed

Thanks for review. Committed to trunk in r17063.

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 as closed 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.