Modify

Opened 9 years ago

Closed 3 years ago

#8911 closed enhancement (wontfix)

[PATCH] suppress some users from assign-to box, especially current track user and ticket owner

Reported by: Patrick Schaaf Owned by: Morris
Priority: normal Component: FlexibleAssignToPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

(also sent to trac-dev@…, but I don't know whether that goes through)

for a plugin I'm working on, which is designed to provide the IValidOwnerProvider interface, I need access to req.authname, and ideally also to ticket.owner for the ticket under consideration.

I need this for an optional feature of removing / forbidding the current user (or ticket owner) as a next-step assignee in a workflow.

I managed to get at req.authname, but only by modifying FlexibleAssignTo itself to pass down the req parameter to the getUsers method.

And I did not "immediately" find a way to get at the ticket information itself, so I'm still missing the desired forbid-current-ticket-owner functionality.

Is there some generic way I missed, to get at both pieces of information from that place? Some self.env magic?

best regards

Patrick

Attachments (2)

flexible-req.patch (980 bytes) - added by Patrick Schaaf 9 years ago.
what I patched to get at req
flexible-suppress.patch (5.8 KB) - added by Patrick Schaaf 9 years ago.
Solving the problem properly - a contribution to FlexibleAssignTo

Download all attachments as: .zip

Change History (6)

Changed 9 years ago by Patrick Schaaf

Attachment: flexible-req.patch added

what I patched to get at req

Changed 9 years ago by Patrick Schaaf

Attachment: flexible-suppress.patch added

Solving the problem properly - a contribution to FlexibleAssignTo

comment:1 Changed 9 years ago by Patrick Schaaf

After sleeping over it for a night, I realized that the proper solution to my problem would be a different modification to FlexibleAssignTo.

My second patch, flexible-suppress.patch, could IMHO be applied. It provides a generic way to suppress a list of users from the assign-to box, after and independant of the IValidOwnerProviders.

  • in section [flexibleassignto] a new variable suppress can be set to a list of usernames that should ALWAYS be suppressed:
    [flexibleassignto]
    suppress = admin, anonymous
    
  • in each workflow step, a new variable .flexibleassignto_suppress can be set in a similar fashion, giving additional users to suppress for that step only:
    [ticket-workflow]
    ...
    mystep.flexibleassignto_suppress = somefreak, $OWNER
    
  • in these suppression lists, $USER can be used to refer to the currently authenticated user (req.authname)
  • also, $OWNER can be used to refer to the current ticket owner, if any.

I have tested the patch on trac 0.11, but it applies also to the 0.13 subdirectory. Lacking a 0.13 install, I _hope_ I have the different DB syntax right, but did not test that.

comment:2 Changed 9 years ago by Patrick Schaaf

FYI: I have just put up my IValidOwnerProvider on trac-hacks:

GroupingAssignToPlugin

Maybe you want to provide a cross-link from the FlexibleAssignTo page.

comment:3 Changed 9 years ago by Patrick Schaaf

Summary: access to ticket / request data[PATCH] suppress some users from assign-to box, especially current track user and ticket owner

comment:4 Changed 3 years ago by Ryan J Ollos

Resolution: wontfix
Status: newclosed

The plugin is deprecated in Trac 1.3.2 and later. To customize the list of users that appear in the assign-to list, subclass ConfigurableTicketWorkflow and override the get_allowed_owners method.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Morris.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.